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





batchdata0.dat

! Data file for `batch1.mos' and `batch2.mos'

a: [2 4 6 8 10 9 7 5 3 1]
b: [9 7 5 3 1 2 4 6 8 10]

Back to examples browserPrevious exampleNext example