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)
  • 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





myconst_test.mos

(!******************************************************
   Mosel NI Examples
   =================

   File myconst_test.mos
   `````````````````````
   Using module myconstants

   *** Compile myconstants.mos before running this model ****

   (c) 2008 Fair Isaac Corporation 
       author: S. Heipcke, 2002
*******************************************************!)

model "Test myconstants module"

 uses "myconstants"

 writeln(MYCST_LINE)
 writeln("BigM value: ", MYCST_BIGM, ", tolerance value: ", MYCST_TOL)
 writeln("Boolean flags: ", MYCST_FLAG, " ", MYCST_NOFLAG)
 writeln(MYCST_LINE)
 
end-model

Back to examples browserPrevious exampleNext example