@@ -234,7 +234,7 @@ bool SplitterStep::mergePartialSolutions() const {
234234 if (!IncludeInMergedResults[i])
235235 continue ;
236236
237- CS.applySolution (PartialSolutions[i][indices[i]]);
237+ CS.replaySolution (PartialSolutions[i][indices[i]]);
238238 }
239239
240240 // This solution might be worse than the best solution found so far.
@@ -328,7 +328,7 @@ StepResult ComponentStep::take(bool prevFailed) {
328328 // If there are any dependent partial solutions to compose, do so now.
329329 if (!DependsOnPartialSolutions.empty ()) {
330330 for (auto partial : DependsOnPartialSolutions) {
331- CS.applySolution (*partial);
331+ CS.replaySolution (*partial);
332332 }
333333
334334 // Activate all of the one-way constraints.
@@ -879,7 +879,8 @@ bool ConjunctionStep::attempt(const ConjunctionElement &element) {
879879 // Note that solution is removed here. This is done
880880 // because we want build a single complete solution
881881 // incrementally.
882- CS.applySolution (Solutions.pop_back_val ());
882+ CS.replaySolution (Solutions.pop_back_val (),
883+ /* shouldIncrementScore=*/ false );
883884 }
884885
885886 // Make sure that element is solved in isolation
@@ -1024,9 +1025,10 @@ StepResult ConjunctionStep::resume(bool prevFailed) {
10241025 for (auto &solution : Solutions) {
10251026 ConstraintSystem::SolverScope scope (CS);
10261027
1027- CS.applySolution (solution);
1028+ CS.replaySolution (solution,
1029+ /* shouldIncrementScore=*/ false );
10281030
1029- // `applySolution ` changes best/current scores
1031+ // `replaySolution ` changes best/current scores
10301032 // of the constraint system, so they have to be
10311033 // restored right afterwards because score of the
10321034 // element does contribute to the overall score.
@@ -1100,8 +1102,9 @@ void ConjunctionStep::restoreOuterState(const Score &solutionScore) const {
11001102 }
11011103}
11021104
1103- void ConjunctionStep::SolverSnapshot::applySolution (const Solution &solution) {
1104- CS.applySolution (solution);
1105+ void ConjunctionStep::SolverSnapshot::replaySolution (const Solution &solution) {
1106+ CS.replaySolution (solution,
1107+ /* shouldIncreaseScore=*/ false );
11051108
11061109 if (!CS.shouldAttemptFixes ())
11071110 return ;
0 commit comments