Limit solving duration to 2 seconds
This commit is contained in:
parent
dfd736183f
commit
25bfddf417
|
@ -20,9 +20,9 @@ public class ShiftScheduleApp {
|
|||
SolverFactory<ShiftSchedule> solverFactory = SolverFactory.create(new SolverConfig().withSolutionClass(ShiftSchedule.class)
|
||||
.withEntityClasses(Shift.class)
|
||||
.withConstraintProviderClass(ShiftScheduleConstraintProvider.class)
|
||||
// The solver runs only for 5 seconds on this small dataset.
|
||||
// It's recommended to run for at least 5 minutes ("5m") otherwise.
|
||||
.withTerminationSpentLimit(Duration.ofSeconds(5)));
|
||||
// The solver runs only for 2 seconds on this tiny dataset.
|
||||
// It's recommended to run for at least 5 minutes ("5m") on large datasets.
|
||||
.withTerminationSpentLimit(Duration.ofSeconds(2)));
|
||||
Solver<ShiftSchedule> solver = solverFactory.buildSolver();
|
||||
|
||||
ShiftSchedule problem = loadProblem();
|
||||
|
|
Loading…
Reference in New Issue