Solving the master model

Provides the syntax.

The master model is contained in the following variables:

   var masterDef = thisOplModel.modelDefinition;
   var masterCplex = cplex;
   var masterData = thisOplModel.dataElements;   
   
   // Creating the master-model
   var masterOpl = new IloOplModel(masterDef, masterCplex);
   masterOpl.addDataSource(masterData);

We reuse the thisOplModel variable because the master model corresponds to the definition contained in the same file as the flow control script. At each iteration, a new IloOplModel instance is created from the newly modified data elements.

Before you can solve, you need to generate the optimization model by calling:


thisOplModel.generate()

To solve the master model, call:

      if ( masterCplex.solve() ) {
        masterOpl.postProcess();
        curr = masterCplex.getObjValue();
        writeln();
        writeln("MASTER OBJECTIVE: ",curr);
      } else {
         writeln("No solution to master problem!");
         masterOpl.end();
         break;
      }