Originally posted by: mikeab
Alex,
This is the Log File output:
Pool Capacity = 5
Population Limit = 4
Number of Solutions = 4
---------
sol = 0 objective= 3
y= [0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0]
---------
sol = 1 objective= 4
y= [0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1]
---------
sol = 2 objective= 3
y= [0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1]
---------
sol = 3 objective= 5
y= [1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0]
Tuple Set for the Solution Pool = {<3 5>}
Post Process Result {}
and this is my main block code:
main{
thisOplModel.generate();
cplex.solnpoolcapacity = 5;
cplex.PopulateLim = 4;
writeln("Pool Capacity = ", cplex.solnpoolcapacity );
writeln("Population Limit = ", cplex.populatelim );
cplex.solve();
if(cplex.populate()){
var nsolns = cplex.solnPoolNsolns;
writeln("Number of Solutions = ", nsolns);
for(var s = 0 ; s < nsolns ; s++){
thisOplModel.setPoolSolution(s);
writeln(" --------- ");
writeln("sol = ", s, " objective= ", cplex.getObjValue(s));
writeln("y= ", thisOplModel.y, " ");
thisOplModel.Sol.add(s, cplex.getObjValue(s));
}
}
writeln("Tuple Set for the Solution Pool = ", thisOplModel.Sol);
thisOplModel.postProcess();
}
as you can see up there the Tuple Set for the Solution Pool = {<3 5>} has only one element which is the last solution (sol #3 int solution pool with objective function value of 5 {<3 5>} but when I run the execute block right after the main block the results will be : Post Process Result {} which means the tuple set Sol is empty.
Why is that happening ?
Thanks for your support.
#DecisionOptimization#OPLusingCPLEXOptimizer