Originally posted by: Redhat11
Hi,
I am using the solution pool to print the found soulutions. However, I have two problems:
1. the order of the found solutions is not the correct order of when the solutions have been found. It seems mixed up, not even the reversed order.
2. I want to print out the solvling times when each solution has been found. The code snippet below does not work, it always prints out the entire time it took to find the global optimal solution.
var before = new Date();
var temp = before.getTime();
if (cplex.solve()) {
writeln("x = " + thisOplModel.x);
writeln("y = " + thisOplModel.y);
var nsolns = cplex.getSolnPoolNsolns();
writeln("Number of Solutions found = " + nsolns);
writeln();
for (var solution=nsolns; solution>0; solution--) {
thisOplModel.setPoolSolution(solution);
writeln("y = " + thisOplModel.y);
writeln(cplex.getObjValue());
var after = new Date();
writeln("solving time ~= ",after.getTime()-temp);
}
}
Anyone can help me?
Cheers
#DecisionOptimization#OPLusingCPLEXOptimizer