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

Looping over optimization runs (within a model, batch executions, and multiple models/submodel)

Description
This example shows different possibilities of looping over a series of optimization runs using different data sets.
  • In the first case (batch1.mos) the loop is implemented within a single Mosel model. At every loop execution a new data set is read and the model is redefined correspondingly.
  • The second model (batch2.mos) only defines and solves once the optimization problem. It is run either from a batch file (runbatch2), or from an application using the Mosel Libraries (batch2.c), or as a submodel from a second Mosel model (runbatch2.mos) and receives the name of the data set to be used through a runtime parameter.


Source Files
By clicking on a file name, a preview is opened at the bottom of this page.
batch1.mos[download]
batch2.mos[download]
batch2.c[download]
runbatch2[download]
runbatch2.mos[download]

Data Files





runbatch2

mosel comp batch2.mos
mosel run batch2
mosel run batch2 INFILE=batchdata1.dat OUTFILE=batchdata2.dat LIM=110
mosel run batch2 INFILE=batchdata2.dat OUTFILE=batchdata3.dat LIM=120

Back to examples browserPrevious exampleNext example