Make propagation stops sooner if time limit is met (fix issue #1062)#1064
Make propagation stops sooner if time limit is met (fix issue #1062)#1064ArthurGodet wants to merge 2 commits intomasterfrom
Conversation
| manageModifications(); | ||
| for (int i = nextNotEmpty(); i > -1; i = nextNotEmpty()) { | ||
| assert !pro_queue[i].isEmpty() : "try to pop a propagator from an empty queue"; | ||
| if (model.getSolver().isTimeLimitMet()) { |
There was a problem hiding this comment.
why not calling model.getSolver().isStopCriterionMet() ?
This would avoid modifying the Solver class.
There was a problem hiding this comment.
The idea was to have a simple check on the time limit, and not check all the stopping criterion before the propagation of each propagator.
Indeed, all stopping criterion but the time limit do not depend on the problem's state outside of fixpoint. Unless you can think of one that would.
There was a problem hiding this comment.
Personnaly, I would have move the code to the end of the while-loop just to keep the main purpose (ie, propagating) clear
| boolean solved = solver.solve(); | ||
| long took = System.currentTimeMillis() - start; | ||
| | ||
| assertFalse(solved); |
There was a problem hiding this comment.
Good to check that solve() returns false;
| manageModifications(); | ||
| for (int i = nextNotEmpty(); i > -1; i = nextNotEmpty()) { | ||
| assert !pro_queue[i].isEmpty() : "try to pop a propagator from an empty queue"; | ||
| if (model.getSolver().isTimeLimitMet()) { |
There was a problem hiding this comment.
Personnaly, I would have move the code to the end of the while-loop just to keep the main purpose (ie, propagating) clear
No description provided.