[CP-SAT] deprecate SearchAllSolutions and SolveWithSolutionCallback

This commit is contained in:
Laurent Perron
2021-05-03 12:11:39 +02:00
parent bd43a1c004
commit efd16c78da
72 changed files with 241 additions and 99 deletions

View File

@@ -71,7 +71,10 @@ public class SearchForAllSolutionsSampleSat {
// [START solve]
CpSolver solver = new CpSolver();
VarArraySolutionPrinter cb = new VarArraySolutionPrinter(new IntVar[] {x, y, z});
solver.searchAllSolutions(model, cb);
// Tell the solver to enumerate all solutions.
solver.getParameters().setEnumerateAllSolutions(true);
// And solve.
solver.solve(model, cb);
// [END solve]
System.out.println(cb.getSolutionCount() + " solutions found.");