org.optaplanner.core.impl.phase.custom

## Class DefaultCustomPhase<Solution_>

- java.lang.Object
- - org.optaplanner.core.impl.phase.AbstractPhase<Solution_>
  - - org.optaplanner.core.impl.phase.custom.DefaultCustomPhase<Solution_>

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

      public class DefaultCustomPhase<Solution_>
      extends AbstractPhase<Solution_>
      implements CustomPhase<Solution_>

  Default implementation of `CustomPhase`.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected List<CustomPhaseCommand<Solution_>>` | `customPhaseCommandList`
    `protected boolean` | `forceUpdateBestSolution`

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

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultCustomPhase(int phaseIndex, String logIndentation, BestSolutionRecaller<Solution_> bestSolutionRecaller, Termination termination)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getPhaseTypeString()`
    `void` | `phaseEnded(CustomPhaseScope<Solution_> phaseScope)`
    `void` | `phaseStarted(CustomPhaseScope<Solution_> phaseScope)`
    `void` | `setCustomPhaseCommandList(List<CustomPhaseCommand<Solution_>> customPhaseCommandList)`
    `void` | `setForceUpdateBestSolution(boolean forceUpdateBestSolution)`
    `void` | `solve(DefaultSolverScope<Solution_> solverScope)`
    `void` | `stepEnded(CustomStepScope<Solution_> stepScope)`
    `void` | `stepStarted(CustomStepScope<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, solvingEnded, solvingStarted, 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`

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

      `solvingEnded, solvingStarted`

- - ### Field Detail

    - #### customPhaseCommandList

          protected List<CustomPhaseCommand<Solution_>> customPhaseCommandList

    - #### forceUpdateBestSolution

          protected boolean forceUpdateBestSolution

  - ### Constructor Detail

    - #### DefaultCustomPhase

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

  - ### Method Detail

    - #### setCustomPhaseCommandList

          public void setCustomPhaseCommandList(List<CustomPhaseCommand<Solution_>> customPhaseCommandList)

    - #### setForceUpdateBestSolution

          public void setForceUpdateBestSolution(boolean forceUpdateBestSolution)

    - #### 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_>`

    - #### phaseStarted

          public void phaseStarted(CustomPhaseScope<Solution_> phaseScope)

    - #### stepStarted

          public void stepStarted(CustomStepScope<Solution_> stepScope)

    - #### stepEnded

          public void stepEnded(CustomStepScope<Solution_> stepScope)

    - #### phaseEnded

          public void phaseEnded(CustomPhaseScope<Solution_> phaseScope)

Copyright © 2006–2021 JBoss by Red Hat. All rights reserved.