Class AbstractMove<Solution_>
java.lang.Object
org.optaplanner.core.impl.heuristic.move.AbstractMove<Solution_>
- Type Parameters:
- Solution_- the solution type, the class with the- PlanningSolutionannotation
- All Implemented Interfaces:
- Move<Solution_>
- Direct Known Subclasses:
- ChangeMove,- KOptMove,- ListAssignMove,- ListChangeMove,- ListSwapMove,- ListUnassignMove,- NoChangeMove,- PartitionChangeMove,- PillarChangeMove,- PillarSwapMove,- SubChainChangeMove,- SubChainReversingChangeMove,- SubChainReversingSwapMove,- SubChainSwapMove,- SubListChangeMove,- SubListSwapMove,- SwapMove,- TailChainSwapMove
Abstract superclass for 
Move.- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract AbstractMove<Solution_>createUndoMove(ScoreDirector<Solution_> scoreDirector) Called before the move is done, so the move can be evaluated and then be undone without resulting into a permanent change in the solution.final AbstractMove<Solution_>doMove(ScoreDirector<Solution_> scoreDirector) Does the move (which indirectly affects theScoreDirector.getWorkingSolution()).protected abstract voiddoMoveOnGenuineVariables(ScoreDirector<Solution_> scoreDirector) LikedoMoveOnly(ScoreDirector)but without theScoreDirector.triggerVariableListeners()call (becausedoMoveOnly(ScoreDirector)already does that).final voiddoMoveOnly(ScoreDirector<Solution_> scoreDirector) As defined byMove.doMove(ScoreDirector), but does not return an undo move.static Object[]rebaseArray(Object[] externalObjects, ScoreDirector<?> destinationScoreDirector) static <E> List<E>rebaseList(List<E> externalObjectList, ScoreDirector<?> destinationScoreDirector) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.optaplanner.core.impl.heuristic.move.MovegetPlanningEntities, getPlanningValues, getSimpleMoveTypeDescription, isMoveDoable, rebase
- 
Constructor Details- 
AbstractMovepublic AbstractMove()
 
- 
- 
Method Details- 
doMoveDescription 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 interface- Move<Solution_>
- Parameters:
- scoreDirector- never null, the- ScoreDirectorthat needs to get notified of the changes
- Returns:
- an undoMove which does the exact opposite of this move
 
- 
doMoveOnlyDescription copied from interface:MoveAs defined byMove.doMove(ScoreDirector), but does not return an undo move.- Specified by:
- doMoveOnlyin interface- Move<Solution_>
- Parameters:
- scoreDirector- never null, the- ScoreDirectorthat needs to get notified of the changes
 
- 
createUndoMoveCalled before the move is done, so the move can be evaluated and then be undone without resulting into a permanent change in the solution.- Parameters:
- scoreDirector- the- ScoreDirectornot yet modified by the move.
- Returns:
- an undoMove which does the exact opposite of this move.
 
- 
doMoveOnGenuineVariablesLikedoMoveOnly(ScoreDirector)but without theScoreDirector.triggerVariableListeners()call (becausedoMoveOnly(ScoreDirector)already does that).- Parameters:
- scoreDirector- never null
 
- 
rebaseListpublic static <E> List<E> rebaseList(List<E> externalObjectList, ScoreDirector<?> destinationScoreDirector) 
- 
rebaseArraypublic static Object[] rebaseArray(Object[] externalObjects, ScoreDirector<?> destinationScoreDirector) 
 
-