Class ResetKeepsLimits
java.lang.Object
org.clafer.choco.ResetKeepsLimits
Stop criteria, for example a time limit, that survive
reset(Solver).
Choco's reset removes them, but the solvers in Clafer reset the search to
find further solutions under the same limits. Choco's solver is final, so
the limits are kept in a hook of its model and the solvers in Clafer reset
through reset(Solver) instead of Solver.reset().
A time limit is a deadline: it counts from the call to
limitTime(Solver, long), not from the last reset, because Choco
restarts its clock on reset.- Author:
- MichaĆ Antkiewicz
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidlimitTime(org.chocosolver.solver.Solver solver, long ms) Stop the search oncemsmilliseconds have passed, even across resets.static voidreset(org.chocosolver.solver.Solver solver) Reset the search and restore the limits set withlimitTime(Solver, long).
-
Method Details
-
limitTime
Stop the search oncemsmilliseconds have passed, even across resets.- Parameters:
solver- the solverms- the time limit in milliseconds
-
reset
Reset the search and restore the limits set withlimitTime(Solver, long).- Parameters:
solver- the solver
-