Class AbstractNearbySelector<Solution_,ChildSelector_ extends PhaseLifecycleListener<Solution_>,ReplayingSelector_ extends PhaseLifecycleListener<Solution_>>
java.lang.Object
org.optaplanner.core.impl.heuristic.selector.AbstractSelector<Solution_>
org.optaplanner.core.impl.heuristic.selector.AbstractDemandEnabledSelector<Solution_>
org.optaplanner.core.impl.heuristic.selector.common.nearby.AbstractNearbySelector<Solution_,ChildSelector_,ReplayingSelector_>
- All Implemented Interfaces:
EventListener
,Selector<Solution_>
,PhaseLifecycleListener<Solution_>
,SolverLifecycleListener<Solution_>
- Direct Known Subclasses:
NearEntityNearbyEntitySelector
,NearEntityNearbyValueSelector
,NearSubListNearbyDestinationSelector
,NearSubListNearbySubListSelector
,NearValueNearbyDestinationSelector
,NearValueNearbyValueSelector
public abstract class AbstractNearbySelector<Solution_,ChildSelector_ extends PhaseLifecycleListener<Solution_>,ReplayingSelector_ extends PhaseLifecycleListener<Solution_>>
extends AbstractDemandEnabledSelector<Solution_>
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ChildSelector_
protected NearbyDistanceMatrix<Object,
Object> protected final NearbyDistanceMeter<?,
?> protected final NearbyRandom
protected final boolean
protected final ReplayingSelector_
Fields inherited from class org.optaplanner.core.impl.heuristic.selector.AbstractSelector
logger, phaseLifecycleSupport, workingRandom
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractNearbySelector
(ChildSelector_ childSelector, Object replayingSelector, NearbyDistanceMeter<?, ?> nearbyDistanceMeter, NearbyRandom nearbyRandom, boolean randomSelection) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ReplayingSelector_
castReplayingSelector
(Object uncastReplayingSelector) protected abstract AbstractNearbyDistanceMatrixDemand<?,
?, ?, ?> final boolean
final AbstractNearbyDistanceMatrixDemand<?,
?, ?, ?> final int
hashCode()
final boolean
Is true ifSelector.isCountable()
is false or if this selector is in random order (for most cases).void
phaseEnded
(AbstractPhaseScope<Solution_> phaseScope) final void
phaseStarted
(AbstractPhaseScope<Solution_> phaseScope) final String
toString()
Methods inherited from class org.optaplanner.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 org.optaplanner.core.impl.heuristic.selector.Selector
isCountable
Methods inherited from interface org.optaplanner.core.impl.solver.event.SolverLifecycleListener
solvingError
-
Field Details
-
childSelector
-
replayingSelector
-
nearbyDistanceMeter
-
nearbyRandom
-
randomSelection
protected final boolean randomSelection -
nearbyDistanceMatrix
-
-
Constructor Details
-
AbstractNearbySelector
protected AbstractNearbySelector(ChildSelector_ childSelector, Object replayingSelector, NearbyDistanceMeter<?, ?> nearbyDistanceMeter, NearbyRandom nearbyRandom, boolean randomSelection)
-
-
Method Details
-
castReplayingSelector
-
createDemand
-
getNearbyDistanceMatrixDemand
-
phaseStarted
- Specified by:
phaseStarted
in interfacePhaseLifecycleListener<Solution_>
- Overrides:
phaseStarted
in classAbstractSelector<Solution_>
-
phaseEnded
- Specified by:
phaseEnded
in interfacePhaseLifecycleListener<Solution_>
- Overrides:
phaseEnded
in classAbstractSelector<Solution_>
-
isNeverEnding
public final boolean isNeverEnding()Description copied from interface:Selector
Is true ifSelector.isCountable()
is false or if this selector is in random order (for most cases). Is never true when this selector is in shuffled order (which is less scalable but more exact).- Returns:
- true if the
Iterator.hasNext()
of theIterator
created byIterable.iterator()
never returns false (except when it's empty).
-
equals
- Specified by:
equals
in classAbstractDemandEnabledSelector<Solution_>
-
hashCode
public final int hashCode()- Specified by:
hashCode
in classAbstractDemandEnabledSelector<Solution_>
-
toString
-