Class NearEntityNearbyValueSelector<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_>
org.optaplanner.core.impl.heuristic.selector.value.nearby.NearEntityNearbyValueSelector<Solution_>
- All Implemented Interfaces:
EventListener
,Selector<Solution_>
,ValueSelector<Solution_>
,PhaseLifecycleListener<Solution_>
,SolverLifecycleListener<Solution_>
public final class NearEntityNearbyValueSelector<Solution_>
extends AbstractNearbySelector<Solution_,ChildSelector_,ReplayingSelector_>
-
Field Summary
Fields inherited from class org.optaplanner.core.impl.heuristic.selector.common.nearby.AbstractNearbySelector
childSelector, nearbyDistanceMatrix, nearbyDistanceMeter, nearbyRandom, randomSelection, replayingSelector
Fields inherited from class org.optaplanner.core.impl.heuristic.selector.AbstractSelector
logger, phaseLifecycleSupport, workingRandom
-
Constructor Summary
ConstructorDescriptionNearEntityNearbyValueSelector
(ValueSelector<Solution_> childValueSelector, EntitySelector<Solution_> originEntitySelector, NearbyDistanceMeter<?, ?> nearbyDistanceMeter, NearbyRandom nearbyRandom, boolean randomSelection) -
Method Summary
Modifier and TypeMethodDescriptionprotected EntitySelector<Solution_>
castReplayingSelector
(Object uncastReplayingSelector) protected AbstractNearbyDistanceMatrixDemand<?,
?, ?, ?> endingIterator
(Object entity) IfSelector.isNeverEnding()
is true, thenValueSelector.iterator(Object)
will never end.long
Similar toIterableSelector.getSize()
, but requires an entity.boolean
If false, thenSelector.isNeverEnding()
is true.Similar toIterable.iterator()
, but requires an entity.Methods inherited from class org.optaplanner.core.impl.heuristic.selector.common.nearby.AbstractNearbySelector
equals, getNearbyDistanceMatrixDemand, hashCode, isNeverEnding, phaseEnded, phaseStarted, 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.phase.event.PhaseLifecycleListener
phaseEnded, phaseStarted, stepEnded, stepStarted
Methods inherited from interface org.optaplanner.core.impl.heuristic.selector.Selector
getCacheType, isNeverEnding
Methods inherited from interface org.optaplanner.core.impl.solver.event.SolverLifecycleListener
solvingEnded, solvingError, solvingStarted
-
Constructor Details
-
NearEntityNearbyValueSelector
public NearEntityNearbyValueSelector(ValueSelector<Solution_> childValueSelector, EntitySelector<Solution_> originEntitySelector, NearbyDistanceMeter<?, ?> nearbyDistanceMeter, NearbyRandom nearbyRandom, boolean randomSelection)
-
-
Method Details
-
getVariableDescriptor
- Returns:
- never null
-
castReplayingSelector
- Specified by:
castReplayingSelector
in classAbstractNearbySelector<Solution_,
ValueSelector<Solution_>, EntitySelector<Solution_>>
-
createDemand
- Specified by:
createDemand
in classAbstractNearbySelector<Solution_,
ValueSelector<Solution_>, EntitySelector<Solution_>>
-
isCountable
public boolean isCountable()Description copied from interface:Selector
If false, thenSelector.isNeverEnding()
is true.- Returns:
- true if all the
ValueRange
s are countable (for example a double value range between 1.2 and 1.4 is not countable)
-
getSize
Description copied from interface:ValueSelector
Similar toIterableSelector.getSize()
, but requires an entity.- Parameters:
entity
- never null- Returns:
- the approximate number of elements generated by this
Selector
, always>= 0
-
iterator
Description copied from interface:ValueSelector
Similar toIterable.iterator()
, but requires an entity.- Parameters:
entity
- never null- Returns:
- never null
-
endingIterator
Description copied from interface:ValueSelector
IfSelector.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 thisValueSelector
entirely.- Parameters:
entity
- never null- Returns:
- never null
- See Also:
-