Originally posted by: AndyHam
Dear IBM,
I always thank for valuable feedbacks I have received from this forum.
How to report ObjValues in different timelimits?
I need to report the ObjValues in 1, 5, 60, and 180 seconds, respectively. Right now, I am reporting them in the following way, which is an inefficient way, namely, solving 4 times. I have two wishes:
1. solve a problem just once with 180 s and report ObjValues for four different timelimits.
2. identify optimality of each ObjValue (right now, I compare SolveTime with timelimit. If SolveTime < timelimit, then I assume it is optimal.)
For instance, I would like to generate the following logs:
//timelimit, solve time to hit the best solution, obj value, optimality
"1 secs, 1.10, , 200 , no
"5 secs, 2.98, , 198 , no
"60 secs, 47.17, , 192 , yes
"180 secs, 47.17, , 192 , yes
(note "the solve time to hit the best solution" can be much shorter than timelimt)
for(var i=1;i<=4;i++)
{
var tLimit;
if (i==1) tLimit=1;
if (i==2) tLimit=5;
if (i==3) tLimit=60;
if (i==4) tLimit=180;
cp.param.timelimit=tLimit;
if (cp.solve()) {
ofile.writeln(i + "sec," + cp.info.SolveTime+ "," + cp.getObjValue());
} else {
ofile.writeln(i + "sec," + cp.info.SolveTime+ "," + "no solution");
};
Any help will be appreciated.
Andy
#DecisionOptimization#OPLusingCPOptimizer