javaconstraint-programmingchoco

Is there a way to limit solutions in choco CPSolver 2.1 like there is in Solver 4.10?


I have an old Choco 2.1.4 project and would like to limit the number of solutions solvedto 2 as I am only interested in knowing if there are 0, 1 or more than one solutions and would like to shave some time off the solver.solve() call when there are many solutions. I see in choco 4.10.8 there is a method

Solver s = model.getSolver();
s.limitSolution(x);

Is there a way to do that in choco 2.1.4 or do I need to update to 4.10.8 - if so is there a good update guide somewhere as the classes and methods have changed.

Thanks!


Solution

  • As far as I can tell something like limitSolution(x) is not possible in 2.1.4, gotta upgrade to version 4.10.8 I guess if I want something like that.