Package org.optaplanner.core.impl.heuristic.selector

## Interface Selector<Solution_>

- All Superinterfaces:
    `EventListener`, `PhaseLifecycleListener<Solution_>`, `SolverLifecycleListener<Solution_>`
  All Known Subinterfaces:
    `EntityIndependentValueSelector<Solution_>`, `EntitySelector<Solution_>`, `IterableSelector<Solution_,​T>`, `ListIterableSelector<Solution_,​T>`, `MoveSelector<Solution_>`, `PillarSelector<Solution_>`, `SubChainSelector<Solution_>`, `ValueSelector<Solution_>`
  All Known Implementing Classes:
    `AbstractCachingEntitySelector`, `AbstractCachingMoveSelector`, `AbstractCachingValueSelector`, `AbstractEntitySelector`, `AbstractMoveSelector`, `AbstractSelector`, `AbstractValueSelector`, `CachingEntitySelector`, `CachingMoveSelector`, `CachingValueSelector`, `CartesianProductMoveSelector`, `ChangeMoveSelector`, `CompositeMoveSelector`, `DefaultPillarSelector`, `DefaultSubChainSelector`, `DowncastingValueSelector`, `EntityDependentSortingValueSelector`, `EntityIndependentFilteringValueSelector`, `EntityIndependentInitializedValueSelector`, `FilteringEntitySelector`, `FilteringMoveSelector`, `FilteringValueSelector`, `FromEntityPropertyValueSelector`, `FromSolutionEntitySelector`, `FromSolutionPropertyValueSelector`, `GenericMoveSelector`, `InitializedValueSelector`, `KOptMoveSelector`, `MimicRecordingEntitySelector`, `MimicRecordingValueSelector`, `MimicReplayingEntitySelector`, `MimicReplayingValueSelector`, `MoveIteratorFactoryToMoveSelectorBridge`, `MoveListFactoryToMoveSelectorBridge`, `NearEntityNearbyEntitySelector`, `NearEntityNearbyValueSelector`, `PillarChangeMoveSelector`, `PillarSwapMoveSelector`, `ProbabilityEntitySelector`, `ProbabilityMoveSelector`, `ProbabilityValueSelector`, `ReinitializeVariableValueSelector`, `SelectedCountLimitEntitySelector`, `SelectedCountLimitMoveSelector`, `SelectedCountLimitValueSelector`, `ShufflingEntitySelector`, `ShufflingMoveSelector`, `ShufflingValueSelector`, `SortingEntitySelector`, `SortingMoveSelector`, `SortingValueSelector`, `SubChainChangeMoveSelector`, `SubChainSwapMoveSelector`, `SwapMoveSelector`, `TailChainSwapMoveSelector`, `UnionMoveSelector`

      public interface Selector<Solution_>
      extends PhaseLifecycleListener<Solution_>

  General interface for `MoveSelector`, `EntitySelector` and `ValueSelector` which generates `Move`s or parts of them.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `SelectionCacheType` | `getCacheType()` | Unless this selector itself caches, this returns `SelectionCacheType.JUST_IN_TIME`, even if a selector child caches.
    `boolean` | `isCountable()` | If false, then `isNeverEnding()` is true.
    `boolean` | `isNeverEnding()` | Is true if `isCountable()` is false or if this selector is in random order (for most cases).

    - ### Methods inherited from interface org.optaplanner.core.impl.phase.event.PhaseLifecycleListener

      `phaseEnded, phaseStarted, stepEnded, stepStarted`

    - ### Methods inherited from interface org.optaplanner.core.impl.solver.event.SolverLifecycleListener

      `solvingEnded, solvingStarted`

- - ### Method Detail

    - #### isCountable

          boolean isCountable()

      If false, then `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)

    - #### isNeverEnding

          boolean isNeverEnding()

      Is true if `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 the `Iterator` created by `Iterable.iterator()` never returns false (except when it's empty).

    - #### getCacheType

          SelectionCacheType getCacheType()

      Unless this selector itself caches, this returns `SelectionCacheType.JUST_IN_TIME`, even if a selector child caches.
      Returns:
        never null