Originally posted by: SystemAdmin
[UDOPS said:]
While linking and testing my model into a multi-model flow control structure, I noticed that post-processing execute scripts were ignored when the model runs as part of a flow control. Is this intentional?
My test case is a basic flow "control" of:
main { //start main program
//Create feasible network space problem instance and solve
var feasiblecode = new IloOplModelSource("Rail Feasible.mod"); //load model structure from file
var feasiblemodel = new IloOplModelDefinition(feasiblecode); //convert model instructions to OPL internal model
var feasibleinstance = new IloOplModel(feasiblemodel,cplex); //link model to solution engine, name the combination
var hypergraphfromdatabase = new IloOplDataSource("Rail Feasible.dat"); //create a handle to the data specification
feasibleinstance.addDataSource(hypergraphfromdatabase); //attach data reference to model instance "feasibleinstance"
feasibleinstance.generate(); //generate or expand the model in preparation for sending to cplex
if ( cplex.solve() ) { //send to cplex and check result
var netsize = cplex.getObjValue();
writeln();
writeln("Solution value (arc count): ",netsize);
}
else {
writeln("Error: No solution! Check data.");
} //end of solve if/else statement
} //end main statement
"Rail Feasible.mod" has post processing scripts which run when the model is solved alone in its own configuration, but they are ignored when run in this flow. That could be a rude surprise to some! This model also has pre-processing scripts, and I know they are still running under flow control because they write reports to the scripting log.
#DecisionOptimization#OPLusingCPLEXOptimizer