org.optaplanner.core.impl.phase

## Interface Phase<Solution_>

- Type Parameters:
    `Solution_` - the solution type, the class with the `PlanningSolution` annotation
  All Superinterfaces:
    EventListener, PhaseLifecycleListener<Solution_>, SolverLifecycleListener<Solution_>
  All Known Subinterfaces:
    ConstructionHeuristicPhase<Solution_>, CustomPhase<Solution_>, ExhaustiveSearchPhase<Solution_>, LocalSearchPhase<Solution_>, PartitionedSearchPhase<Solution_>
  All Known Implementing Classes:
    AbstractPhase, DefaultConstructionHeuristicPhase, DefaultCustomPhase, DefaultExhaustiveSearchPhase, DefaultLocalSearchPhase, DefaultPartitionedSearchPhase, NoChangePhase

      public interface Phase<Solution_>
      extends PhaseLifecycleListener<Solution_>

  A phase of a `Solver`.
  See Also:
    `AbstractPhase`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addPhaseLifecycleListener(PhaseLifecycleListener<Solution_> phaseLifecycleListener)` Add a `PhaseLifecycleListener` that is only notified of the `phase` and the `PhaseLifecycleListener.stepStarted(AbstractStepScope)` step} starting/ending events from this phase (and the `SolverLifecycleListener.solvingStarted(DefaultSolverScope)` solving} events too of course).
    `void` | `removePhaseLifecycleListener(PhaseLifecycleListener<Solution_> phaseLifecycleListener)`
    `void` | `setSolverPhaseLifecycleSupport(PhaseLifecycleSupport<Solution_> solverPhaseLifecycleSupport)` Used to make `AbstractSolver.addPhaseLifecycleListener(PhaseLifecycleListener)` work.
    `void` | `solve(DefaultSolverScope<Solution_> solverScope)`

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

    - #### setSolverPhaseLifecycleSupport

          void setSolverPhaseLifecycleSupport(PhaseLifecycleSupport<Solution_> solverPhaseLifecycleSupport)

      Used to make `AbstractSolver.addPhaseLifecycleListener(PhaseLifecycleListener)` work.
      Parameters:
        `solverPhaseLifecycleSupport` - never null

    - #### addPhaseLifecycleListener

          void addPhaseLifecycleListener(PhaseLifecycleListener<Solution_> phaseLifecycleListener)

      Add a `PhaseLifecycleListener` that is only notified of the `phase` and the `PhaseLifecycleListener.stepStarted(AbstractStepScope)` step} starting/ending events from this phase (and the `SolverLifecycleListener.solvingStarted(DefaultSolverScope)` solving} events too of course).

      To get notified for all phases, use `AbstractSolver.addPhaseLifecycleListener(PhaseLifecycleListener)` instead.

      Parameters:
        `phaseLifecycleListener` - never null

    - #### removePhaseLifecycleListener

          void removePhaseLifecycleListener(PhaseLifecycleListener<Solution_> phaseLifecycleListener)

      Parameters:
        `phaseLifecycleListener` - never null
      See Also:
        `addPhaseLifecycleListener(PhaseLifecycleListener)`

    - #### solve

          void solve(DefaultSolverScope<Solution_> solverScope)

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