Package org.optaplanner.core.impl.localsearch

## Class DefaultLocalSearchPhase<Solution_>

- java.lang.Object
- - org.optaplanner.core.impl.phase.AbstractPhase<Solution_>
  - - org.optaplanner.core.impl.localsearch.DefaultLocalSearchPhase<Solution_>

- Type Parameters:
    `Solution_` - the solution type, the class with the `PlanningSolution` annotation
  All Implemented Interfaces:
    `EventListener`, `LocalSearchPhaseLifecycleListener<Solution_>`, `LocalSearchPhase<Solution_>`, `PhaseLifecycleListener<Solution_>`, `Phase<Solution_>`, `SolverLifecycleListener<Solution_>`

      public class DefaultLocalSearchPhase<Solution_>
      extends AbstractPhase<Solution_>
      implements LocalSearchPhase<Solution_>, LocalSearchPhaseLifecycleListener<Solution_>

  Default implementation of `LocalSearchPhase`.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected LocalSearchDecider<Solution_>` | `decider` |

    - ### Fields inherited from class org.optaplanner.core.impl.phase.AbstractPhase

      `assertExpectedStepScore, assertShadowVariablesAreNotStaleAfterStep, assertStepScoreFromScratch, bestSolutionRecaller, logger, logIndentation, phaseIndex, phaseLifecycleSupport, solverPhaseLifecycleSupport, termination`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DefaultLocalSearchPhase​(int phaseIndex, String logIndentation, BestSolutionRecaller<Solution_> bestSolutionRecaller, Termination termination)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `doStep​(LocalSearchStepScope<Solution_> stepScope)` |
    `LocalSearchDecider<Solution_>` | `getDecider()` |
    `String` | `getPhaseTypeString()` |
    `void` | `phaseEnded​(LocalSearchPhaseScope<Solution_> phaseScope)` |
    `void` | `phaseStarted​(LocalSearchPhaseScope<Solution_> phaseScope)` |
    `void` | `setDecider​(LocalSearchDecider<Solution_> decider)` |
    `void` | `solve​(DefaultSolverScope<Solution_> solverScope)` |
    `void` | `solvingEnded​(DefaultSolverScope<Solution_> solverScope)` |
    `void` | `solvingStarted​(DefaultSolverScope<Solution_> solverScope)` |
    `void` | `stepEnded​(LocalSearchStepScope<Solution_> stepScope)` |
    `void` | `stepStarted​(LocalSearchStepScope<Solution_> stepScope)` |

    - ### Methods inherited from class org.optaplanner.core.impl.phase.AbstractPhase

      `addPhaseLifecycleListener, assertWorkingSolutionInitialized, calculateWorkingStepScore, getPhaseIndex, getTermination, isAssertExpectedStepScore, isAssertShadowVariablesAreNotStaleAfterStep, isAssertStepScoreFromScratch, phaseEnded, phaseStarted, predictWorkingStepScore, removePhaseLifecycleListener, setAssertExpectedStepScore, setAssertShadowVariablesAreNotStaleAfterStep, setAssertStepScoreFromScratch, setSolverPhaseLifecycleSupport, stepEnded, stepStarted`

    - ### 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.phase.Phase

      `addPhaseLifecycleListener, removePhaseLifecycleListener, setSolverPhaseLifecycleSupport`

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

      `phaseEnded, phaseStarted, stepEnded, stepStarted`

- - ### Field Detail

    - #### decider

          protected LocalSearchDecider<Solution_> decider

  - ### Constructor Detail

    - #### DefaultLocalSearchPhase

          public DefaultLocalSearchPhase​(int phaseIndex,
                                         String logIndentation,
                                         BestSolutionRecaller<Solution_> bestSolutionRecaller,
                                         Termination termination)

  - ### Method Detail

    - #### getDecider

          public LocalSearchDecider<Solution_> getDecider()

    - #### setDecider

          public void setDecider​(LocalSearchDecider<Solution_> decider)

    - #### getPhaseTypeString

          public String getPhaseTypeString()

      Specified by:
        `getPhaseTypeString` in class `AbstractPhase<Solution_>`

    - #### solve

          public void solve​(DefaultSolverScope<Solution_> solverScope)

      Specified by:
        `solve` in interface `Phase<Solution_>`

    - #### doStep

          protected void doStep​(LocalSearchStepScope<Solution_> stepScope)

    - #### solvingStarted

          public void solvingStarted​(DefaultSolverScope<Solution_> solverScope)

      Specified by:
        `solvingStarted` in interface `SolverLifecycleListener<Solution_>`
      Overrides:
        `solvingStarted` in class `AbstractPhase<Solution_>`

    - #### phaseStarted

          public void phaseStarted​(LocalSearchPhaseScope<Solution_> phaseScope)

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

    - #### stepStarted

          public void stepStarted​(LocalSearchStepScope<Solution_> stepScope)

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

    - #### stepEnded

          public void stepEnded​(LocalSearchStepScope<Solution_> stepScope)

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

    - #### phaseEnded

          public void phaseEnded​(LocalSearchPhaseScope<Solution_> phaseScope)

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

    - #### solvingEnded

          public void solvingEnded​(DefaultSolverScope<Solution_> solverScope)

      Specified by:
        `solvingEnded` in interface `SolverLifecycleListener<Solution_>`
      Overrides:
        `solvingEnded` in class `AbstractPhase<Solution_>`