Interface MoveStreamFactory<Solution_>
- All Known Implementing Classes:
DefaultMoveStreamFactory
-
Method Summary
Modifier and TypeMethodDescription<A> UniEnumeratingStream<Solution_,A> Start aEnumeratingStreamof all instances of the sourceClass that are known asproblem factsorplanning entities.<Entity_,Value_>
UniEnumeratingStream<Solution_,ElementPosition> forEachAssignablePosition(PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel) Deprecated, for removal: This API element is subject to removal in a future version.<Entity_,Value_>
UniEnumeratingStream<Solution_,Value_> forEachAssignedValue(PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel) Enumerate all values assigned to any entity'sPlanningListVariable.<Entity_,Value_>
UniEnumeratingStream<Solution_,Value_> forEachAssignedValueUnfiltered(PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel) Enumerate all values assigned to any entity'sPlanningListVariable.<Entity_,Value_>
UniEnumeratingStream<Solution_,PositionInList> forEachDestination(PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel) Enumerate all possible positions of a list variable to which a value can be assigned.<Entity_,Value_>
UniEnumeratingStream<Solution_,ElementPosition> forEachDestinationIncludingUnassigned(PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel) As defined byforEachDestination(PlanningListVariableMetaModel), but also includes a singleUnassignedElementposition if the list variable allows unassigned values.<A> UniEnumeratingStream<Solution_,A> forEachUnfiltered(Class<A> sourceClass, boolean includeNull) Start aEnumeratingStreamof all instances of the sourceClass that are known asproblem factsorplanning entities.<A> UniSamplingStream<Solution_,A> pick(UniEnumeratingStream<Solution_, A> enumeratingStream)
-
Method Details
-
forEach
Start aEnumeratingStreamof all instances of the sourceClass that are known asproblem factsorplanning entities.If the sourceClass is a
PlanningEntity, then it is automaticallyfilteredto only contain entities which are not pinned.If the sourceClass is a shadow entity (an entity without any genuine planning variables), and if there exists a genuine
PlanningEntitywith aPlanningListVariablewhich accepts instances of this shadow entity as values in that list, then this stream will filter out all sourceClass instances which are pinned in that list.This stream returns genuine entities regardless of whether they have any null genuine planning variables. This stream returns shadow entities regardless of whether they are assigned to any genuine entity. They can easily be
filtered out.- Parameters:
sourceClass- the class of the instances to enumerateincludeNull- if true, the stream will include a single null element- Returns:
- A stream containing a tuple for each of the entities as described above.
- See Also:
-
forEachUnfiltered
Start aEnumeratingStreamof all instances of the sourceClass that are known asproblem factsorplanning entities. If the sourceClass is a genuine or shadow entity, it returns instances regardless of their pinning status. Otherwise as defined byforEach(Class, boolean). -
forEachAssignedValueUnfiltered
<Entity_,Value_> UniEnumeratingStream<Solution_,Value_> forEachAssignedValueUnfiltered(PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel) Enumerate all values assigned to any entity'sPlanningListVariable. UnlikeforEachAssignedValue(PlanningListVariableMetaModel), this will include pinned values. You can useSolutionView.getPositionOf(PlanningListVariableMetaModel, Object)later downstream to get the position of the value in an entity's list variable, if needed.- Parameters:
variableMetaModel- the meta model of the list variable to enumerate- Returns:
- enumerating stream with all values as defined above
- See Also:
-
forEachAssignedValue
<Entity_,Value_> UniEnumeratingStream<Solution_,Value_> forEachAssignedValue(PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel) Enumerate all values assigned to any entity'sPlanningListVariable. This will not include any pinned positions or fully pinned entities. You can useSolutionView.getPositionOf(PlanningListVariableMetaModel, Object)later downstream to get the position of the value in an entity's list variable, if needed.- Parameters:
variableMetaModel- the meta model of the list variable to enumerate- Returns:
- enumerating stream with all values as defined above
- See Also:
-
forEachDestination
<Entity_,Value_> UniEnumeratingStream<Solution_,PositionInList> forEachDestination(PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel) Enumerate all possible positions of a list variable to which a value can be assigned. This will include one position past the current end of the list, allowing for assigning at the end of a list. It will not include any pinned positions or fully pinned entities, as well asUnassignedElement. To includeUnassignedElement, useforEachDestinationIncludingUnassigned(PlanningListVariableMetaModel)instead.- Parameters:
variableMetaModel- the meta model of the list variable to enumerate- Returns:
- enumerating stream with positions as defined above
- See Also:
-
forEachDestinationIncludingUnassigned
<Entity_,Value_> UniEnumeratingStream<Solution_,ElementPosition> forEachDestinationIncludingUnassigned(PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel) As defined byforEachDestination(PlanningListVariableMetaModel), but also includes a singleUnassignedElementposition if the list variable allows unassigned values. If the list variable does not allow unassigned values, then this method behaves exactly the same asforEachDestination(PlanningListVariableMetaModel). -
pick
-
forEachAssignablePosition
@Deprecated(forRemoval=true) <Entity_,Value_> UniEnumeratingStream<Solution_,ElementPosition> forEachAssignablePosition(PlanningListVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel) Deprecated, for removal: This API element is subject to removal in a future version.UseforEachDestinationIncludingUnassigned(PlanningListVariableMetaModel)instead, or see ifforEachDestination(PlanningListVariableMetaModel)orforEachAssignedValue(PlanningListVariableMetaModel)fits your needs better.Enumerate all possible positions of a list variable to which a value can be assigned. This will eliminate all positions onpinned entities, as well as allpinned indexes. If the list variableallows unassigned values, the resulting stream will include a single instance ofUnassignedElementinstance.Will be removed right before this API is moved out of preview.
- Parameters:
variableMetaModel- the meta model of the list variable to enumerate- Returns:
- enumerating stream with all assignable positions of a given list variable
- See Also:
-
forEachDestinationIncludingUnassigned(PlanningListVariableMetaModel)instead, or see ifforEachDestination(PlanningListVariableMetaModel)orforEachAssignedValue(PlanningListVariableMetaModel)fits your needs better.