|
4 | 4 |
|
5 | 5 | import ai.timefold.solver.core.api.score.Score;
|
6 | 6 | import ai.timefold.solver.core.impl.domain.solution.descriptor.SolutionDescriptor;
|
| 7 | +import ai.timefold.solver.core.impl.heuristic.move.LegacyMoveAdapter; |
7 | 8 | import ai.timefold.solver.core.impl.score.director.InnerScore;
|
8 | 9 | import ai.timefold.solver.core.preview.api.move.Move;
|
9 | 10 |
|
@@ -36,6 +37,32 @@ public void assertMoveAndApply(Solution_ solution, Move<Solution_> move, Consume
|
36 | 37 | assertMove(solution, move, moveSolutionConsumer, true);
|
37 | 38 | }
|
38 | 39 |
|
| 40 | + public void assertMoveAndUndo(Solution_ solution, ai.timefold.solver.core.impl.heuristic.move.Move<Solution_> move) { |
| 41 | + assertMoveAndUndo(solution, move, (ignored) -> { |
| 42 | + }); |
| 43 | + } |
| 44 | + |
| 45 | + public void assertMoveAndUndo(Solution_ solution, ai.timefold.solver.core.impl.heuristic.move.Move<Solution_> move, |
| 46 | + Consumer<Solution_> moveSolutionConsumer) { |
| 47 | + assertMove(solution, move, moveSolutionConsumer, false); |
| 48 | + } |
| 49 | + |
| 50 | + public void assertMoveAndApply(Solution_ solution, ai.timefold.solver.core.impl.heuristic.move.Move<Solution_> move) { |
| 51 | + assertMoveAndApply(solution, move, (ignored) -> { |
| 52 | + }); |
| 53 | + } |
| 54 | + |
| 55 | + public void assertMoveAndApply(Solution_ solution, ai.timefold.solver.core.impl.heuristic.move.Move<Solution_> move, |
| 56 | + Consumer<Solution_> moveSolutionConsumer) { |
| 57 | + assertMove(solution, move, moveSolutionConsumer, true); |
| 58 | + } |
| 59 | + |
| 60 | + private void assertMove(Solution_ solution, ai.timefold.solver.core.impl.heuristic.move.Move<Solution_> move, |
| 61 | + Consumer<Solution_> moveSolutionConsumer, |
| 62 | + boolean applyMove) { |
| 63 | + assertMove(solution, new LegacyMoveAdapter<>(move), moveSolutionConsumer, applyMove); |
| 64 | + } |
| 65 | + |
39 | 66 | private void assertMove(Solution_ solution, Move<Solution_> move, Consumer<Solution_> moveSolutionConsumer,
|
40 | 67 | boolean applyMove) {
|
41 | 68 | var scoreDirectorFactory = new MoveAssertScoreDirectorFactory<>(solutionDescriptor, moveSolutionConsumer);
|
|
0 commit comments