Originally posted by: vplus
Hi,
I am a newbie, sorry if this question seems to be too easy for you.
I am writing a model with column generation. In the main function, I put something like (which is very standard):
function printSolution(){
}
minimize ...;
main {
...
thisOplModel.generate();
var Data = thisOplModel.dataElements;
var masterDef = thisOplModel.modelDefinition;
var masterCplex = cplex;
while (true) {
var masterOpl = new IloOplModel(masterDef, masterCplex);
masterOpl.addDataSource(Data);
masterOpl.generate();
// blah blah blah
// If found a solution, then print it
printSolution();
}
}
Which puzzles me is that , the function
printSolution()
should need an input - this case would be masterOpl - to print the result correctly. However, without the input, it still works. Maybe it's because main function is in the master.mod file, but it's not very clear since the object masterOpl is created several times
italics inside
italics the
main
.
Thanks.
#DecisionOptimization#OPLusingCPLEXOptimizer