Class AbstractSimplifiedMove<Solution_>
java.lang.Object
ai.timefold.solver.core.impl.heuristic.move.AbstractSimplifiedMove<Solution_>
- Type Parameters:
Solution_-
- All Implemented Interfaces:
Move<Solution_>
- Direct Known Subclasses:
ListAssignMove,ListUnassignMove,NoChangeMove,SubListUnassignMove
This is an alternative to
AbstractMove,
allowing to trade some performance for less boilerplate.
This move will record all events that change variables,
and replay them in the undo move,
therefore removing the need to implement the undo move.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoMove(ScoreDirector<Solution_> scoreDirector) Does the move (which indirectly affects theScoreDirector.getWorkingSolution()).protected abstract voiddoMoveOnGenuineVariables(ScoreDirector<Solution_> scoreDirector) final voiddoMoveOnly(ScoreDirector<Solution_> scoreDirector) As defined byMove.doMove(ScoreDirector), but does not return an undo move.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ai.timefold.solver.core.impl.heuristic.move.Move
getPlanningEntities, getPlanningValues, getSimpleMoveTypeDescription, isMoveDoable, rebase
-
Constructor Details
-
AbstractSimplifiedMove
public AbstractSimplifiedMove()
-
-
Method Details
-
doMove
Description copied from interface:MoveDoes the move (which indirectly affects theScoreDirector.getWorkingSolution()). When theworking solutionis modified, theScoreDirectormust be correctly notified (throughScoreDirector.beforeVariableChanged(Object, String)andScoreDirector.afterVariableChanged(Object, String)), otherwise later calculatedScores will be corrupted.This method must end with calling
ScoreDirector.triggerVariableListeners()to ensure all shadow variables are updated.This method must return an undo move, so the move can be evaluated and then be undone without resulting into a permanent change in the solution.
- Specified by:
doMovein interfaceMove<Solution_>- Parameters:
scoreDirector- never null, theScoreDirectorthat needs to get notified of the changes- Returns:
- an undoMove which does the exact opposite of this move
-
doMoveOnly
Description copied from interface:MoveAs defined byMove.doMove(ScoreDirector), but does not return an undo move.- Specified by:
doMoveOnlyin interfaceMove<Solution_>- Parameters:
scoreDirector- never null, theScoreDirectorthat needs to get notified of the changes
-
doMoveOnGenuineVariables
-
toString
-