Interface MutableSolutionView<Solution_>
- Type Parameters:
Solution_-
- All Superinterfaces:
SolutionView<Solution_>
- All Known Subinterfaces:
InnerMutableSolutionView<Solution_>
- All Known Implementing Classes:
EphemeralMoveDirector,MoveDirector
Contains all reading and mutating methods available to a
Move
in order to change the state of a planning solution.
This package and all of its contents are part of the Move Streams API, which is under development and is only offered as a preview feature. There are no guarantees for backward compatibility; any class, method or field may change or be removed without prior notice, although we will strive to avoid this as much as possible.
We encourage you to try the API and give us feedback on your experience with it, before we finalize the API. Please direct your feedback to Timefold Solver Github.
-
Method Summary
Modifier and TypeMethodDescription<Entity_,Value_>
voidchangeVariable(@NonNull PlanningVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel, @NonNull Entity_ entity, @Nullable Value_ newValue) Reads the value of a @basic planning variableof a given entity.<Entity_,Value_>
voidmoveValueBetweenLists(@NonNull PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel, @NonNull Entity_ sourceEntity, int sourceIndex, @NonNull Entity_ destinationEntity, int destinationIndex) Moves a value from one entity'splanning list variableto another.<Entity_,Value_>
voidmoveValueInList(@NonNull PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel, @NonNull Entity_ entity, int sourceIndex, int destinationIndex) Moves a value within one entity'splanning list variable.voidTells the underlyingScoreDirectorto notify the solver of the mutating operations performed by theMove.Methods inherited from interface ai.timefold.solver.core.preview.api.move.SolutionView
getPositionOf, getValue, getValueAtIndex
-
Method Details
-
changeVariable
<Entity_,Value_> void changeVariable(@NonNull PlanningVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel, @NonNull Entity_ entity, @Nullable Value_ newValue) Reads the value of a @basic planning variableof a given entity.- Parameters:
variableMetaModel- Describes the variable to be changed.entity- The entity whose variable value is to be changed.newValue- maybe null, if unassigning the variable
-
moveValueBetweenLists
<Entity_,Value_> void moveValueBetweenLists(@NonNull PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel, @NonNull Entity_ sourceEntity, int sourceIndex, @NonNull Entity_ destinationEntity, int destinationIndex) Moves a value from one entity'splanning list variableto another.- Parameters:
variableMetaModel- Describes the variable to be changed.sourceEntity- The first entity whose variable value is to be changed.sourceIndex- >= 0destinationEntity- The second entity whose variable value is to be changed.destinationIndex- >= 0- Throws:
IndexOutOfBoundsException- if the index is out of bounds
-
moveValueInList
<Entity_,Value_> void moveValueInList(@NonNull PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel, @NonNull Entity_ entity, int sourceIndex, int destinationIndex) Moves a value within one entity'splanning list variable.- Parameters:
variableMetaModel- Describes the variable to be changed.entity- The entity whose variable value is to be changed.sourceIndex- >= 0destinationIndex- >= 0- Throws:
IndexOutOfBoundsException- if the index is out of bounds
-
updateShadowVariables
void updateShadowVariables()Tells the underlyingScoreDirectorto notify the solver of the mutating operations performed by theMove.
-