FICO
FICO Xpress Optimization Examples Repository
FICO Optimization Community FICO Xpress Optimization Home
Back to examples browserPrevious exampleNext example

Writing packages: definition of constant symbols, subroutines, types, and parameters

Description
Packages are libraries written in the Mosel language that extend the language with
  • constant symbols (myconstants.mos)
  • subroutines (definition of several overloaded versions of a procedure in solarraypkg.mos, generic implementation using union types and iterator in solarrayanypkg.mos)
  • types (definition of a structure 'arc' to represent arcs in a network with a function to access information: arcpkg.mos)
  • parameters (definition of real/integer/string/boolean valued package parameters: parpkg.mos)
Further explanation of this example: 'Mosel User Guide', Chapter 16 Packages


Source Files

Data Files





arcs.dat

! Data file for `arcs.mos'

ARC: [(1) ["A" "B" 2]
      (2) ["A" "D" 4]
      (3) ["A" "C" 7]
      (4) ["B" "F" 4]
      (5) ["B" "D" 3]
      (6) ["C" "B" 5]
      (7) ["C" "D" 1]
      (8) ["C" "E" 1]
      (9) ["D" "F" 2]
     (10) ["D" "E" 5]
     (11) ["E" "F" 8]]

Back to examples browserPrevious exampleNext example