Class AbstractCachingMoveSelector
- java.lang.Object
- 
- org.optaplanner.core.impl.heuristic.selector.AbstractSelector
- 
- org.optaplanner.core.impl.heuristic.selector.move.AbstractMoveSelector
- 
- org.optaplanner.core.impl.heuristic.selector.move.decorator.AbstractCachingMoveSelector
 
 
 
- 
- All Implemented Interfaces:
- Iterable<Move>,- EventListener,- SelectionCacheLifecycleListener,- IterableSelector<Move>,- MoveSelector,- Selector,- PhaseLifecycleListener,- SolverLifecycleListener
 - Direct Known Subclasses:
- CachingMoveSelector,- ShufflingMoveSelector,- SortingMoveSelector
 
 public abstract class AbstractCachingMoveSelector extends AbstractMoveSelector implements SelectionCacheLifecycleListener 
- 
- 
Field SummaryFields Modifier and Type Field Description protected List<Move>cachedMoveListprotected SelectionCacheTypecacheTypeprotected MoveSelectorchildMoveSelector- 
Fields inherited from class org.optaplanner.core.impl.heuristic.selector.AbstractSelectorlogger, phaseLifecycleSupport, workingRandom
 
- 
 - 
Constructor SummaryConstructors Constructor Description AbstractCachingMoveSelector(MoveSelector childMoveSelector, SelectionCacheType cacheType)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconstructCache(DefaultSolverScope solverScope)voiddisposeCache(DefaultSolverScope solverScope)SelectionCacheTypegetCacheType()Unless this selector itself caches, this returnsSelectionCacheType.JUST_IN_TIME, even if a selector child caches.MoveSelectorgetChildMoveSelector()longgetSize()A random JITSelectorwithSelector.isNeverEnding()true should return a size as if it would be able to return each distinct element only once, because the size can be used inSelectionProbabilityWeightFactory.booleanisCountable()If false, thenSelector.isNeverEnding()is true.- 
Methods inherited from class org.optaplanner.core.impl.heuristic.selector.AbstractSelectorphaseEnded, phaseStarted, solvingEnded, solvingStarted, stepEnded, stepStarted
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface java.lang.IterableforEach, iterator, spliterator
 - 
Methods inherited from interface org.optaplanner.core.impl.heuristic.selector.move.MoveSelectorsupportsPhaseAndSolverCaching
 - 
Methods inherited from interface org.optaplanner.core.impl.phase.event.PhaseLifecycleListenerphaseEnded, phaseStarted, stepEnded, stepStarted
 - 
Methods inherited from interface org.optaplanner.core.impl.heuristic.selector.SelectorisNeverEnding
 - 
Methods inherited from interface org.optaplanner.core.impl.solver.event.SolverLifecycleListenersolvingEnded, solvingStarted
 
- 
 
- 
- 
- 
Field Detail- 
childMoveSelectorprotected final MoveSelector childMoveSelector 
 - 
cacheTypeprotected final SelectionCacheType cacheType 
 
- 
 - 
Constructor Detail- 
AbstractCachingMoveSelectorpublic AbstractCachingMoveSelector(MoveSelector childMoveSelector, SelectionCacheType cacheType) 
 
- 
 - 
Method Detail- 
getChildMoveSelectorpublic MoveSelector getChildMoveSelector() 
 - 
getCacheTypepublic SelectionCacheType getCacheType() Description copied from interface:SelectorUnless this selector itself caches, this returnsSelectionCacheType.JUST_IN_TIME, even if a selector child caches.- Specified by:
- getCacheTypein interface- Selector
- Overrides:
- getCacheTypein class- AbstractSelector
- Returns:
- never null
 
 - 
constructCachepublic void constructCache(DefaultSolverScope solverScope) - Specified by:
- constructCachein interface- SelectionCacheLifecycleListener
 
 - 
disposeCachepublic void disposeCache(DefaultSolverScope solverScope) - Specified by:
- disposeCachein interface- SelectionCacheLifecycleListener
 
 - 
isCountablepublic boolean isCountable() Description copied from interface:SelectorIf false, thenSelector.isNeverEnding()is true.- Specified by:
- isCountablein interface- Selector
- Returns:
- true if all the ValueRanges are countable (for example a double value range between 1.2 and 1.4 is not countable)
 
 - 
getSizepublic long getSize() Description copied from interface:IterableSelectorA random JITSelectorwithSelector.isNeverEnding()true should return a size as if it would be able to return each distinct element only once, because the size can be used inSelectionProbabilityWeightFactory.- Specified by:
- getSizein interface- IterableSelector<Move>
- Returns:
- the approximate number of elements generated by this Selector, always>= 0
 
 
- 
 
-