Interface SolutionView<Solution_>
- Type Parameters:
Solution_-
- All Known Subinterfaces:
InnerMutableSolutionView<Solution_>,MutableSolutionView<Solution_>
- All Known Implementing Classes:
MoveDirector
@NullMarked
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 Summary
Modifier and TypeMethodDescription<Entity_,Value_>
ElementPositiongetPositionOf(PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel, Value_ value) Locates a given value in any @list planning variable.<Entity_,Value_>
@Nullable Value_getValue(PlanningVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel, Entity_ entity) Reads the value of a @basic planning variableof a given entity.<Entity_,Value_>
Value_getValueAtIndex(PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel, Entity_ entity, int index) Reads the value of a @list planning variableof a given entity at a specific index.
-
Method Details
-
getValue
<Entity_,Value_> @Nullable Value_ getValue(PlanningVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel, Entity_ entity) Reads the value of a @basic planning variableof 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_> Value_ getValueAtIndex(PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel, Entity_ entity, int index) Reads the value of a @list planning variableof 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:
- The value at the given index in the list variable.
- Throws:
NullPointerException- if the value of the list variable is nullIndexOutOfBoundsException- if the index is out of bounds
-
getPositionOf
<Entity_,Value_> ElementPosition getPositionOf(PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel, 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:
- the location of the value in the variable
-