Interface Phase<Solution_>
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotation
- 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,DefaultExhaustiveSearchPhase,DefaultLocalSearchPhase,NoChangePhase
A phase of a
Solver.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddPhaseLifecycleListener(PhaseLifecycleListener<Solution_> phaseLifecycleListener) Add aPhaseLifecycleListenerthat is only notified of thephaseand thestepstarting/ending events from this phase (and thesolvingevents too of course).voidremovePhaseLifecycleListener(PhaseLifecycleListener<Solution_> phaseLifecycleListener) voidsolve(SolverScope<Solution_> solverScope) booleanCheck if a phase triggers the first initialized solution event.Methods inherited from interface ai.timefold.solver.core.impl.phase.event.PhaseLifecycleListener
phaseEnded, phaseStarted, stepEnded, stepStartedMethods inherited from interface ai.timefold.solver.core.impl.solver.event.SolverLifecycleListener
solvingEnded, solvingError, solvingStarted
-
Method Details
-
addPhaseLifecycleListener
Add aPhaseLifecycleListenerthat is only notified of thephaseand thestepstarting/ending events from this phase (and thesolvingevents too of course).To get notified for all phases, use
AbstractSolver.addPhaseLifecycleListener(PhaseLifecycleListener)instead.- Parameters:
phaseLifecycleListener- never null
-
removePhaseLifecycleListener
- Parameters:
phaseLifecycleListener- never null- See Also:
-
solve
-
triggersFirstInitializedSolutionEvent
boolean triggersFirstInitializedSolutionEvent()Check if a phase triggers the first initialized solution event. The first initialized solution immediately precedes the firstLocalSearchPhase.- Returns:
- true if the phase returns the first initialized solution.
- See Also:
-