Interface MutableSolutionView<Solution_>

Type Parameters:
Solution_ -
All Superinterfaces:
SolutionView<Solution_>
All Known Subinterfaces:
InnerMutableSolutionView<Solution_>
All Known Implementing Classes:
EphemeralMoveDirector, MoveDirector

public interface MutableSolutionView<Solution_> extends SolutionView<Solution_>
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 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 variable of 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's planning list variable to another.
      Parameters:
      variableMetaModel - Describes the variable to be changed.
      sourceEntity - The first entity whose variable value is to be changed.
      sourceIndex - >= 0
      destinationEntity - 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's planning list variable.
      Parameters:
      variableMetaModel - Describes the variable to be changed.
      entity - The entity whose variable value is to be changed.
      sourceIndex - >= 0
      destinationIndex - >= 0
      Throws:
      IndexOutOfBoundsException - if the index is out of bounds
    • updateShadowVariables

      void updateShadowVariables()
      Tells the underlying ScoreDirector to notify the solver of the mutating operations performed by the Move.