Dear Choco team and Choco enthusiasts,
I'm trying to print out the statistic to see the total solving time (Building time + Resolution time) in CPU time for when solving optimization problem using Choco 4.10.8 and I'm using the XCPS3 parser.
I wish to know the total solving time in CPU time because I'm comparing a COP solver that I programmed with Choco for my Bachelor Thesis.
According to the doc
here, one should call solver.printStatistics() right after having called solver.Solve().
However since Choco will call solver.Solver() multiple time when solving an optimization problem:
while( solver.Solve() ) {
onSolution(solver, parsers[0]);
}
I'm unsure if putting solver.printStatistics() inside or outside the while loops is for the best.
I understand that Choco will solve the problem again and again to keep optimizing the solution therefore the last solution found would be the best. So I'm unsure if the timer will be reset after each solver.Solve() call ended.
If the timer is reset every time then I assume would need to print statistic inside the loop and then sum up the time reported when printed for each solution.
However when I did so I noticed that the printed resolution time in each call is growing bit by bit as the next solution is found, while the building time remain the same.
This makes me think that the timer won't be reset every time and is actually accumulating as the while loop keep going.
I then tried calling solver.printStatistics() right after the while loop ended and see that the Resolution time is of course very similar (if not the same) with the last solver.printStatistics() call if I have it inside the loop. This makes sense since it would be printing the statistic of the last solver.printStatistics() call.
Now I'm very inclined to think that calling solver.printStatistics() once when the while-loop has just ended is the correct option for what I need due to what I described above.
Would anyone be able to confirm my speculation?
Thank you very much!!
Kind regards,
Hieu Nguyen