Class EphemeralMoveDirector<Solution_>
java.lang.Object
ai.timefold.solver.core.impl.move.director.MoveDirector<Solution_>
ai.timefold.solver.core.impl.move.director.EphemeralMoveDirector<Solution_>
- Type Parameters:
Solution_-
- All Implemented Interfaces:
InnerMutableSolutionView<Solution_>,MutableSolutionView<Solution_>,Rebaser,SolutionView<Solution_>,AutoCloseable
public final class EphemeralMoveDirector<Solution_>
extends MoveDirector<Solution_>
implements AutoCloseable
The only move director that supports undoing moves.
Moves are undone when the director is
closed.-
Field Summary
Fields inherited from class ai.timefold.solver.core.impl.move.director.MoveDirector
scoreDirector -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Moves that are to be undone later need to be run with the instance returned by this method.<Entity_,Value_>
@NonNull ElementLocationgetPositionOf(@NonNull PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel, @NonNull Value_ value) Locates a given value in any @list planning variable.Methods inherited from class ai.timefold.solver.core.impl.move.director.MoveDirector
changeVariable, getPositionOf, getScoreDirector, getValue, getValueAtIndex, moveValueBetweenLists, moveValueInList, rebase, updateShadowVariables
-
Method Details
-
createUndoMove
-
getPositionOf
public <Entity_,Value_> @NonNull ElementLocation getPositionOf(@NonNull PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel, @NonNull Value_ value) Description copied from interface:SolutionViewLocates a given value in any @list planning variable.- Specified by:
getPositionOfin interfaceSolutionView<Solution_>- Overrides:
getPositionOfin classMoveDirector<Solution_>- Parameters:
variableMetaModel- Describes the variable whose value is to be read.value- The value to locate.- Returns:
- never null; the location of the value in the variable
-
getVariableChangeRecordingScoreDirector
-
ephemeral
Description copied from class:MoveDirectorMoves that are to be undone later need to be run with the instance returned by this method.- Overrides:
ephemeralin classMoveDirector<Solution_>- Returns:
- never null
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-