Class UpcomingSelectionIterator<S>
java.lang.Object
ai.timefold.solver.core.impl.heuristic.selector.common.iterator.SelectionIterator<S>
ai.timefold.solver.core.impl.heuristic.selector.common.iterator.UpcomingSelectionIterator<S>
- Type Parameters:
S- Selection type, for example aMoveclass, an entity class or a value class.
- All Implemented Interfaces:
Iterator<S>
- Direct Known Subclasses:
AbstractOriginalChangeIterator,AbstractOriginalSwapIterator,AbstractRandomChangeIterator,AbstractRandomSwapIterator,CartesianProductMoveSelector.OriginalCartesianProductMoveIterator,FilteringEntitySelector.JustInTimeFilteringEntityIterator,FilteringValueSelector.JustInTimeFilteringValueIterator,InitializedValueSelector.JustInTimeInitializedValueIterator,OriginalListChangeIterator,OriginalListSwapIterator,RandomListChangeIterator,RandomListSwapIterator,UpcomingSelectionListIterator
IMPORTANT: The constructor of any subclass of this abstract class, should never call any of its child
Selector's Iterator.hasNext() or Iterator.next() methods,
because that can cause descendant Selectors to be selected too early
(which breaks MimicReplayingEntitySelector).-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Sstatic ElementPositionfindUnpinnedDestination(Iterator<ElementPosition> destinationIterator, ListVariableDescriptor<?> listVariableDescriptor) Some destination iterators, such as nearby destination iterators, may return even elements which are pinned.booleanhasNext()next()protected StoString()Methods inherited from class ai.timefold.solver.core.impl.heuristic.selector.common.iterator.SelectionIterator
removeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
upcomingCreated
protected boolean upcomingCreated -
hasUpcomingSelection
protected boolean hasUpcomingSelection -
upcomingSelection
-
-
Constructor Details
-
UpcomingSelectionIterator
public UpcomingSelectionIterator()
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
createUpcomingSelection
-
noUpcomingSelection
-
toString
-
findUnpinnedDestination
public static ElementPosition findUnpinnedDestination(Iterator<ElementPosition> destinationIterator, ListVariableDescriptor<?> listVariableDescriptor) Some destination iterators, such as nearby destination iterators, may return even elements which are pinned. This is because the nearby matrix always picks from all nearby elements, and is unaware of any pinning. This means that later we need to filter out the pinned elements, so that moves aren't generated for them.- Parameters:
destinationIterator- never nulllistVariableDescriptor- never null- Returns:
- null if no unpinned destination was found, at which point the iterator is exhausted.
-