Interface SolutionView<Solution_>

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

public interface SolutionView<Solution_>
Allows read-only access to the state of the solution that is being operated on by the Move.

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

    • getValue

      <Entity_, Value_> @Nullable Value_ getValue(@NonNull PlanningVariableMetaModel<Solution_,Entity_,Value_> variableMetaModel, @NonNull Entity_ entity)
      Reads the value of a @basic planning variable of a given entity.
      Parameters:
      variableMetaModel - Describes the variable whose value is to be read.
      entity - The entity whose variable is to be read.
      Returns:
      The value of the variable on the entity.
    • getValueAtIndex

      <Entity_, Value_> @Nullable Value_ getValueAtIndex(@NonNull PlanningListVariableMetaModel<Solution_,Entity_,Value_> variableMetaModel, @NonNull Entity_ entity, int index)
      Reads the value of a @list planning variable of a given entity at a specific index.
      Parameters:
      variableMetaModel - Describes the variable whose value is to be read.
      entity - The entity whose variable is to be read.
      index - >= 0
      Returns:
      maybe null; the value of the variable on the entity at the index
      Throws:
      NullPointerException - if the value of the list variable is null
      IndexOutOfBoundsException - if the index is out of bounds
    • getPositionOf

      <Entity_, Value_> @NonNull ElementLocation getPositionOf(@NonNull PlanningListVariableMetaModel<Solution_,Entity_,Value_> variableMetaModel, @NonNull Value_ value)
      Locates a given value in any @list planning variable.
      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