Package org.optaplanner.core.impl.localsearch.decider.forager

## Class AcceptedLocalSearchForager

- java.lang.Object
- - org.optaplanner.core.impl.solver.event.SolverLifecycleListenerAdapter<Solution_>
  - - org.optaplanner.core.impl.localsearch.event.LocalSearchPhaseLifecycleListenerAdapter
    - - org.optaplanner.core.impl.localsearch.decider.forager.AbstractLocalSearchForager
      - - org.optaplanner.core.impl.localsearch.decider.forager.AcceptedLocalSearchForager

- All Implemented Interfaces:
    `EventListener`, `LocalSearchForager`, `LocalSearchPhaseLifecycleListener`, `SolverLifecycleListener`

      public class AcceptedLocalSearchForager
      extends AbstractLocalSearchForager

  A `LocalSearchForager` which forages accepted moves and ignores unaccepted moves.
  See Also:
    `LocalSearchForager`, `Acceptor`

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected int` | `acceptedCountLimit` |
    `protected long` | `acceptedMoveCount` |
    `protected boolean` | `breakTieRandomly` |
    `protected LocalSearchMoveScope` | `earlyPickedMoveScope` |
    `protected FinalistPodium` | `finalistPodium` |
    `protected LocalSearchPickEarlyType` | `pickEarlyType` |
    `protected long` | `selectedMoveCount` |

    - ### Fields inherited from class org.optaplanner.core.impl.localsearch.decider.forager.AbstractLocalSearchForager

      `logger`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AcceptedLocalSearchForager​(FinalistPodium finalistPodium, LocalSearchPickEarlyType pickEarlyType, int acceptedCountLimit, boolean breakTieRandomly)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addMove​(LocalSearchMoveScope moveScope)` |
    `protected void` | `checkPickEarly​(LocalSearchMoveScope moveScope)` |
    `boolean` | `isQuitEarly()` |
    `void` | `phaseEnded​(LocalSearchPhaseScope phaseScope)` |
    `void` | `phaseStarted​(LocalSearchPhaseScope phaseScope)` |
    `LocalSearchMoveScope` | `pickMove​(LocalSearchStepScope stepScope)` |
    `void` | `solvingEnded​(DefaultSolverScope solverScope)` |
    `void` | `solvingStarted​(DefaultSolverScope solverScope)` |
    `void` | `stepEnded​(LocalSearchStepScope stepScope)` |
    `void` | `stepStarted​(LocalSearchStepScope stepScope)` |
    `boolean` | `supportsNeverEndingMoveSelector()` |
    `String` | `toString()` |

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

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

- - ### Field Detail

    - #### finalistPodium

          protected final FinalistPodium finalistPodium

    - #### pickEarlyType

          protected final LocalSearchPickEarlyType pickEarlyType

    - #### acceptedCountLimit

          protected final int acceptedCountLimit

    - #### breakTieRandomly

          protected final boolean breakTieRandomly

    - #### selectedMoveCount

          protected long selectedMoveCount

    - #### acceptedMoveCount

          protected long acceptedMoveCount

    - #### earlyPickedMoveScope

          protected LocalSearchMoveScope earlyPickedMoveScope

  - ### Constructor Detail

    - #### AcceptedLocalSearchForager

          public AcceptedLocalSearchForager​(FinalistPodium finalistPodium,
                                            LocalSearchPickEarlyType pickEarlyType,
                                            int acceptedCountLimit,
                                            boolean breakTieRandomly)

  - ### Method Detail

    - #### solvingStarted

          public void solvingStarted​(DefaultSolverScope solverScope)

      Specified by:
        `solvingStarted` in interface `SolverLifecycleListener`
      Overrides:
        `solvingStarted` in class `SolverLifecycleListenerAdapter`

    - #### phaseStarted

          public void phaseStarted​(LocalSearchPhaseScope phaseScope)

      Specified by:
        `phaseStarted` in interface `LocalSearchPhaseLifecycleListener`
      Overrides:
        `phaseStarted` in class `LocalSearchPhaseLifecycleListenerAdapter`

    - #### stepStarted

          public void stepStarted​(LocalSearchStepScope stepScope)

      Specified by:
        `stepStarted` in interface `LocalSearchPhaseLifecycleListener`
      Overrides:
        `stepStarted` in class `LocalSearchPhaseLifecycleListenerAdapter`

    - #### supportsNeverEndingMoveSelector

          public boolean supportsNeverEndingMoveSelector()

      Returns:
        true if it can be combined with a `Selector.isNeverEnding()` that returns true.

    - #### addMove

          public void addMove​(LocalSearchMoveScope moveScope)

      Parameters:
        `moveScope` - never null

    - #### checkPickEarly

          protected void checkPickEarly​(LocalSearchMoveScope moveScope)

    - #### isQuitEarly

          public boolean isQuitEarly()

      Returns:
        true if no further moves should be selected (and evaluated) for this step.

    - #### pickMove

          public LocalSearchMoveScope pickMove​(LocalSearchStepScope stepScope)

      Parameters:
        `stepScope` - never null
      Returns:
        sometimes null, for example if no move is selected

    - #### stepEnded

          public void stepEnded​(LocalSearchStepScope stepScope)

      Specified by:
        `stepEnded` in interface `LocalSearchPhaseLifecycleListener`
      Overrides:
        `stepEnded` in class `LocalSearchPhaseLifecycleListenerAdapter`

    - #### phaseEnded

          public void phaseEnded​(LocalSearchPhaseScope phaseScope)

      Specified by:
        `phaseEnded` in interface `LocalSearchPhaseLifecycleListener`
      Overrides:
        `phaseEnded` in class `LocalSearchPhaseLifecycleListenerAdapter`

    - #### solvingEnded

          public void solvingEnded​(DefaultSolverScope solverScope)

      Specified by:
        `solvingEnded` in interface `SolverLifecycleListener`
      Overrides:
        `solvingEnded` in class `SolverLifecycleListenerAdapter`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`