Package org.optaplanner.core.impl.phase
Class AbstractPhase<Solution_>
java.lang.Object
org.optaplanner.core.impl.phase.AbstractPhase<Solution_>
- Type Parameters:
- Solution_- the solution type, the class with the- PlanningSolutionannotation
- All Implemented Interfaces:
- EventListener,- PhaseLifecycleListener<Solution_>,- Phase<Solution_>,- SolverLifecycleListener<Solution_>
- Direct Known Subclasses:
- DefaultConstructionHeuristicPhase,- DefaultExhaustiveSearchPhase,- DefaultLocalSearchPhase,- DefaultPartitionedSearchPhase,- NoChangePhase
- See Also:
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final booleanprotected final booleanprotected final booleanprotected final org.slf4j.Loggerprotected final Stringprotected final intprotected PhaseLifecycleSupport<Solution_>protected final Termination<Solution_>protected AbstractSolver<Solution_>
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddPhaseLifecycleListener(PhaseLifecycleListener<Solution_> phaseLifecycleListener) Add aPhaseLifecycleListenerthat is only notified of thephaseand thestepstarting/ending events from this phase (and thesolvingevents too of course).protected voidassertWorkingSolutionInitialized(AbstractPhaseScope<Solution_> phaseScope) protected <Score_ extends Score<Score_>>
 voidcalculateWorkingStepScore(AbstractStepScope<Solution_> stepScope, Object completedAction) intabstract StringbooleanbooleanbooleanvoidphaseEnded(AbstractPhaseScope<Solution_> phaseScope) voidphaseStarted(AbstractPhaseScope<Solution_> phaseScope) protected <Score_ extends Score<Score_>>
 voidpredictWorkingStepScore(AbstractStepScope<Solution_> stepScope, Object completedAction) voidremovePhaseLifecycleListener(PhaseLifecycleListener<Solution_> phaseLifecycleListener) voidsetSolver(AbstractSolver<Solution_> solver) voidsolvingEnded(SolverScope<Solution_> solverScope) voidsolvingStarted(SolverScope<Solution_> solverScope) voidstepEnded(AbstractStepScope<Solution_> stepScope) voidstepStarted(AbstractStepScope<Solution_> stepScope) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.optaplanner.core.impl.solver.event.SolverLifecycleListenersolvingError
- 
Field Details- 
loggerprotected final transient org.slf4j.Logger logger
- 
phaseIndexprotected final int phaseIndex
- 
logIndentation
- 
phaseTermination
- 
assertStepScoreFromScratchprotected final boolean assertStepScoreFromScratch
- 
assertExpectedStepScoreprotected final boolean assertExpectedStepScore
- 
assertShadowVariablesAreNotStaleAfterStepprotected final boolean assertShadowVariablesAreNotStaleAfterStep
- 
phaseLifecycleSupport
- 
solver
 
- 
- 
Constructor Details- 
AbstractPhase
 
- 
- 
Method Details- 
getPhaseIndexpublic int getPhaseIndex()
- 
getPhaseTermination
- 
getSolver
- 
setSolver
- 
isAssertStepScoreFromScratchpublic boolean isAssertStepScoreFromScratch()
- 
isAssertExpectedStepScorepublic boolean isAssertExpectedStepScore()
- 
isAssertShadowVariablesAreNotStaleAfterSteppublic boolean isAssertShadowVariablesAreNotStaleAfterStep()
- 
getPhaseTypeString
- 
solvingStarted- Specified by:
- solvingStartedin interface- SolverLifecycleListener<Solution_>
 
- 
solvingEnded- Specified by:
- solvingEndedin interface- SolverLifecycleListener<Solution_>
 
- 
phaseStarted- Specified by:
- phaseStartedin interface- PhaseLifecycleListener<Solution_>
 
- 
phaseEnded- Specified by:
- phaseEndedin interface- PhaseLifecycleListener<Solution_>
 
- 
stepStarted- Specified by:
- stepStartedin interface- PhaseLifecycleListener<Solution_>
 
- 
calculateWorkingStepScoreprotected <Score_ extends Score<Score_>> void calculateWorkingStepScore(AbstractStepScope<Solution_> stepScope, Object completedAction) 
- 
predictWorkingStepScoreprotected <Score_ extends Score<Score_>> void predictWorkingStepScore(AbstractStepScope<Solution_> stepScope, Object completedAction) 
- 
stepEnded- Specified by:
- stepEndedin interface- PhaseLifecycleListener<Solution_>
 
- 
addPhaseLifecycleListenerDescription copied from interface:PhaseAdd 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.- Specified by:
- addPhaseLifecycleListenerin interface- Phase<Solution_>
- Parameters:
- phaseLifecycleListener- never null
 
- 
removePhaseLifecycleListener- Specified by:
- removePhaseLifecycleListenerin interface- Phase<Solution_>
- Parameters:
- phaseLifecycleListener- never null
- See Also:
 
- 
assertWorkingSolutionInitialized
 
-