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

## Class AbstractSelector<Solution_>

- java.lang.Object
- - org.optaplanner.core.impl.heuristic.selector.AbstractSelector<Solution_>

- All Implemented Interfaces:
    `EventListener`, `Selector<Solution_>`, `PhaseLifecycleListener<Solution_>`, `SolverLifecycleListener<Solution_>`
  Direct Known Subclasses:
    `AbstractEntitySelector`, `AbstractMoveSelector`, `AbstractValueSelector`, `DefaultPillarSelector`, `DefaultSubChainSelector`

      public abstract class AbstractSelector<Solution_>
      extends Object
      implements Selector<Solution_>

  Abstract superclass for `Selector`.
  See Also:
    `Selector`

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected org.slf4j.Logger` | `logger` |
    `protected PhaseLifecycleSupport<Solution_>` | `phaseLifecycleSupport` |
    `protected Random` | `workingRandom` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AbstractSelector()` |

  - ### Method Summary

    All Methods Instance Methods Concrete 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.
    `void` | `phaseEnded​(AbstractPhaseScope<Solution_> phaseScope)` |
    `void` | `phaseStarted​(AbstractPhaseScope<Solution_> phaseScope)` |
    `void` | `solvingEnded​(SolverScope<Solution_> solverScope)` |
    `void` | `solvingStarted​(SolverScope<Solution_> solverScope)` |
    `void` | `stepEnded​(AbstractStepScope<Solution_> stepScope)` |
    `void` | `stepStarted​(AbstractStepScope<Solution_> stepScope)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.optaplanner.core.impl.heuristic.selector.Selector

      `isCountable, isNeverEnding`

- - ### Field Detail

    - #### logger

          protected final transient org.slf4j.Logger logger

    - #### phaseLifecycleSupport

          protected PhaseLifecycleSupport<Solution_> phaseLifecycleSupport

    - #### workingRandom

          protected Random workingRandom

  - ### Constructor Detail

    - #### AbstractSelector

          public AbstractSelector()

  - ### Method Detail

    - #### solvingStarted

          public void solvingStarted​(SolverScope<Solution_> solverScope)

      Specified by:
        `solvingStarted` in interface `SolverLifecycleListener<Solution_>`

    - #### phaseStarted

          public void phaseStarted​(AbstractPhaseScope<Solution_> phaseScope)

      Specified by:
        `phaseStarted` in interface `PhaseLifecycleListener<Solution_>`

    - #### stepStarted

          public void stepStarted​(AbstractStepScope<Solution_> stepScope)

      Specified by:
        `stepStarted` in interface `PhaseLifecycleListener<Solution_>`

    - #### stepEnded

          public void stepEnded​(AbstractStepScope<Solution_> stepScope)

      Specified by:
        `stepEnded` in interface `PhaseLifecycleListener<Solution_>`

    - #### phaseEnded

          public void phaseEnded​(AbstractPhaseScope<Solution_> phaseScope)

      Specified by:
        `phaseEnded` in interface `PhaseLifecycleListener<Solution_>`

    - #### solvingEnded

          public void solvingEnded​(SolverScope<Solution_> solverScope)

      Specified by:
        `solvingEnded` in interface `SolverLifecycleListener<Solution_>`

    - #### getCacheType

          public SelectionCacheType getCacheType()

      Description copied from interface: `Selector`
      Unless this selector itself caches, this returns `SelectionCacheType.JUST_IN_TIME`, even if a selector child caches.
      Specified by:
        `getCacheType` in interface `Selector<Solution_>`
      Returns:
        never null