Solution_
- the solution type, the class with the PlanningSolution
annotationpublic abstract class AbstractMove<Solution_> extends Object implements Move<Solution_>
Move
.Move
Constructor and Description |
---|
AbstractMove() |
Modifier and Type | Method and Description |
---|---|
protected 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.
|
AbstractMove<Solution_> |
doMove(ScoreDirector<Solution_> scoreDirector)
Does the move (which indirectly affects the
ScoreDirector.getWorkingSolution() ). |
protected abstract void |
doMoveOnGenuineVariables(ScoreDirector<Solution_> scoreDirector)
Like
doMove(ScoreDirector) but without the ScoreDirector.triggerVariableListeners() call
(because doMove(ScoreDirector) already does that). |
String |
getSimpleMoveTypeDescription()
Describes the move type for statistical purposes.
|
protected static Object[] |
rebaseArray(Object[] externalObjects,
ScoreDirector<?> destinationScoreDirector) |
protected static <E> List<E> |
rebaseList(List<E> externalObjectList,
ScoreDirector<?> destinationScoreDirector) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPlanningEntities, getPlanningValues, isMoveDoable, rebase
public String getSimpleMoveTypeDescription()
Move
The format is not formalized. Never parse the String
returned by this method.
getSimpleMoveTypeDescription
in interface Move<Solution_>
public final AbstractMove<Solution_> doMove(ScoreDirector<Solution_> scoreDirector)
Move
ScoreDirector.getWorkingSolution()
).
When the working solution
is modified, the ScoreDirector
must be correctly notified
(through ScoreDirector.beforeVariableChanged(Object, String)
and
ScoreDirector.afterVariableChanged(Object, String)
),
otherwise later calculated Score
s 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.
doMove
in interface Move<Solution_>
scoreDirector
- never null, the ScoreDirector
that needs to get notified of the changesprotected abstract AbstractMove<Solution_> createUndoMove(ScoreDirector<Solution_> scoreDirector)
scoreDirector
- the ScoreDirector
not yet modified by the move.protected abstract void doMoveOnGenuineVariables(ScoreDirector<Solution_> scoreDirector)
doMove(ScoreDirector)
but without the ScoreDirector.triggerVariableListeners()
call
(because doMove(ScoreDirector)
already does that).scoreDirector
- never nullprotected static <E> List<E> rebaseList(List<E> externalObjectList, ScoreDirector<?> destinationScoreDirector)
protected static Object[] rebaseArray(Object[] externalObjects, ScoreDirector<?> destinationScoreDirector)
Copyright © 2006–2018 JBoss by Red Hat. All rights reserved.