diff --git a/src/main/java/ai/timefold/solver/benchmarks/micro/scoredirector/problems/AbstractProblem.java b/src/main/java/ai/timefold/solver/benchmarks/micro/scoredirector/problems/AbstractProblem.java index 0ad5f1d1..7a200aed 100644 --- a/src/main/java/ai/timefold/solver/benchmarks/micro/scoredirector/problems/AbstractProblem.java +++ b/src/main/java/ai/timefold/solver/benchmarks/micro/scoredirector/problems/AbstractProblem.java @@ -21,6 +21,7 @@ import ai.timefold.solver.core.impl.localsearch.scope.LocalSearchPhaseScope; import ai.timefold.solver.core.impl.localsearch.scope.LocalSearchStepScope; import ai.timefold.solver.core.impl.move.director.MoveDirector; +import ai.timefold.solver.core.impl.score.constraint.ConstraintMatchPolicy; import ai.timefold.solver.core.impl.score.director.InnerScoreDirector; import ai.timefold.solver.core.impl.score.director.InnerScoreDirectorFactory; import ai.timefold.solver.core.impl.solver.DefaultSolver; @@ -102,7 +103,8 @@ public final void setupTrial() { public final void setupIteration() { // We only care about incremental performance; therefore calculate the entire solution outside of invocation. scoreDirector = scoreDirectorFactory.buildScoreDirector(false, - scoreDirectorType == ScoreDirectorType.CONSTRAINT_STREAMS_JUSTIFIED); + scoreDirectorType == ScoreDirectorType.CONSTRAINT_STREAMS_JUSTIFIED ? ConstraintMatchPolicy.ENABLED + : ConstraintMatchPolicy.DISABLED); scoreDirector.setWorkingSolution(scoreDirector.cloneSolution(originalSolution)); // Use fresh solution again. scoreDirector.triggerVariableListeners(); scoreDirector.calculateScore(); diff --git a/src/main/java/ai/timefold/solver/benchmarks/micro/scoredirector/problems/ProblemInitializer.java b/src/main/java/ai/timefold/solver/benchmarks/micro/scoredirector/problems/ProblemInitializer.java index a42b770b..b5d513bf 100644 --- a/src/main/java/ai/timefold/solver/benchmarks/micro/scoredirector/problems/ProblemInitializer.java +++ b/src/main/java/ai/timefold/solver/benchmarks/micro/scoredirector/problems/ProblemInitializer.java @@ -22,6 +22,7 @@ import ai.timefold.solver.core.impl.constructionheuristic.DefaultConstructionHeuristicPhaseFactory; import ai.timefold.solver.core.impl.domain.solution.descriptor.SolutionDescriptor; import ai.timefold.solver.core.impl.heuristic.HeuristicConfigPolicy; +import ai.timefold.solver.core.impl.score.constraint.ConstraintMatchPolicy; import ai.timefold.solver.core.impl.score.director.InnerScoreDirectorFactory; import ai.timefold.solver.core.impl.solver.ClassInstanceCache; import ai.timefold.solver.core.impl.solver.DefaultSolver; @@ -60,7 +61,7 @@ public static synchronized Solution_ getSolution(Example example, private static Solution_ initialize(Example example, Solution_ uninitializedSolution, InnerScoreDirectorFactory scoreDirectorFactory) { - try (var scoreDirector = scoreDirectorFactory.buildScoreDirector(false, false)) { + try (var scoreDirector = scoreDirectorFactory.buildScoreDirector(false, ConstraintMatchPolicy.DISABLED)) { scoreDirector.setWorkingSolution(uninitializedSolution); scoreDirector.triggerVariableListeners(); var score = scoreDirector.calculateScore();