Class NearEntityNearbyValueSelector<Solution_>
- java.lang.Object
-
- ai.timefold.solver.core.impl.heuristic.selector.AbstractSelector<Solution_>
-
- ai.timefold.solver.core.impl.heuristic.selector.AbstractDemandEnabledSelector<Solution_>
-
- ai.timefold.solver.core.impl.heuristic.selector.common.nearby.AbstractNearbySelector<Solution_,ChildSelector_,ReplayingSelector_>
-
- ai.timefold.solver.core.impl.heuristic.selector.value.nearby.NearEntityNearbyValueSelector<Solution_>
-
- All Implemented Interfaces:
Selector<Solution_>,ValueSelector<Solution_>,PhaseLifecycleListener<Solution_>,SolverLifecycleListener<Solution_>,EventListener
public final class NearEntityNearbyValueSelector<Solution_> extends AbstractNearbySelector<Solution_,ChildSelector_,ReplayingSelector_>
-
-
Field Summary
-
Fields inherited from class ai.timefold.solver.core.impl.heuristic.selector.common.nearby.AbstractNearbySelector
childSelector, nearbyDistanceMatrix, nearbyDistanceMeter, nearbyRandom, randomSelection, replayingSelector
-
Fields inherited from class ai.timefold.solver.core.impl.heuristic.selector.AbstractSelector
logger, phaseLifecycleSupport, workingRandom
-
-
Constructor Summary
Constructors Constructor Description NearEntityNearbyValueSelector(ValueSelector<Solution_> childValueSelector, EntitySelector<Solution_> originEntitySelector, NearbyDistanceMeter<?,?> nearbyDistanceMeter, NearbyRandom nearbyRandom, boolean randomSelection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected EntitySelector<Solution_>castReplayingSelector(Object uncastReplayingSelector)protected AbstractNearbyDistanceMatrixDemand<?,?,?,?>createDemand()Iterator<Object>endingIterator(Object entity)IfSelector.isNeverEnding()is true, thenValueSelector.iterator(Object)will never end.longgetSize(Object entity)Similar toIterableSelector.getSize(), but requires an entity.GenuineVariableDescriptor<Solution_>getVariableDescriptor()booleanisCountable()If false, thenSelector.isNeverEnding()is true.Iterator<Object>iterator(Object entity)Similar toIterable.iterator(), but requires an entity.-
Methods inherited from class ai.timefold.solver.core.impl.heuristic.selector.common.nearby.AbstractNearbySelector
equals, getNearbyDistanceMatrixDemand, hashCode, isNeverEnding, phaseEnded, phaseStarted, toString
-
Methods inherited from class ai.timefold.solver.core.impl.heuristic.selector.AbstractSelector
getCacheType, solvingEnded, solvingStarted, stepEnded, stepStarted
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ai.timefold.solver.core.impl.phase.event.PhaseLifecycleListener
phaseEnded, phaseStarted, stepEnded, stepStarted
-
Methods inherited from interface ai.timefold.solver.core.impl.heuristic.selector.Selector
getCacheType, isNeverEnding
-
Methods inherited from interface ai.timefold.solver.core.impl.solver.event.SolverLifecycleListener
solvingEnded, solvingError, solvingStarted
-
-
-
-
Constructor Detail
-
NearEntityNearbyValueSelector
public NearEntityNearbyValueSelector(ValueSelector<Solution_> childValueSelector, EntitySelector<Solution_> originEntitySelector, NearbyDistanceMeter<?,?> nearbyDistanceMeter, NearbyRandom nearbyRandom, boolean randomSelection)
-
-
Method Detail
-
getVariableDescriptor
public GenuineVariableDescriptor<Solution_> getVariableDescriptor()
- Returns:
- never null
-
castReplayingSelector
protected EntitySelector<Solution_> castReplayingSelector(Object uncastReplayingSelector)
- Specified by:
castReplayingSelectorin classAbstractNearbySelector<Solution_,ValueSelector<Solution_>,EntitySelector<Solution_>>
-
createDemand
protected AbstractNearbyDistanceMatrixDemand<?,?,?,?> createDemand()
- Specified by:
createDemandin classAbstractNearbySelector<Solution_,ValueSelector<Solution_>,EntitySelector<Solution_>>
-
isCountable
public boolean isCountable()
Description copied from interface:SelectorIf false, thenSelector.isNeverEnding()is true.- Returns:
- true if all the
ValueRanges are countable (for example a double value range between 1.2 and 1.4 is not countable)
-
getSize
public long getSize(Object entity)
Description copied from interface:ValueSelectorSimilar toIterableSelector.getSize(), but requires an entity.- Parameters:
entity- never null- Returns:
- the approximate number of elements generated by this
Selector, always>= 0
-
iterator
public Iterator<Object> iterator(Object entity)
Description copied from interface:ValueSelectorSimilar toIterable.iterator(), but requires an entity.- Parameters:
entity- never null- Returns:
- never null
-
endingIterator
public Iterator<Object> endingIterator(Object entity)
Description copied from interface:ValueSelectorIfSelector.isNeverEnding()is true, thenValueSelector.iterator(Object)will never end. This returns an endingIterator, that tries to matchValueSelector.iterator(Object)as much as possible, but return each distinct element only once and therefore it might not respect the configuration of thisValueSelectorentirely.- Parameters:
entity- never null- Returns:
- never null
- See Also:
ValueSelector.iterator(Object)
-
-