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,- DefaultCustomPhase,- DefaultExhaustiveSearchPhase,- DefaultLocalSearchPhase,- DefaultPartitionedSearchPhase,- NoChangePhase
 
 public abstract class AbstractPhase<Solution_> extends Object implements Phase<Solution_> - See Also:
- DefaultLocalSearchPhase
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected booleanassertExpectedStepScoreprotected booleanassertShadowVariablesAreNotStaleAfterStepprotected booleanassertStepScoreFromScratchprotected BestSolutionRecaller<Solution_>bestSolutionRecallerprotected org.slf4j.Loggerloggerprotected StringlogIndentationprotected intphaseIndexprotected PhaseLifecycleSupport<Solution_>phaseLifecycleSupportprotected PhaseLifecycleSupport<Solution_>solverPhaseLifecycleSupportprotected Termination<Solution_>termination
 - 
Constructor SummaryConstructors Constructor Description AbstractPhase(int phaseIndex, String logIndentation, BestSolutionRecaller<Solution_> bestSolutionRecaller, Termination<Solution_> termination)
 - 
Method Summary
 
- 
- 
- 
Field Detail- 
loggerprotected final transient org.slf4j.Logger logger 
 - 
phaseIndexprotected final int phaseIndex 
 - 
logIndentationprotected final String logIndentation 
 - 
bestSolutionRecallerprotected final BestSolutionRecaller<Solution_> bestSolutionRecaller 
 - 
terminationprotected final Termination<Solution_> termination 
 - 
solverPhaseLifecycleSupportprotected PhaseLifecycleSupport<Solution_> solverPhaseLifecycleSupport 
 - 
phaseLifecycleSupportprotected PhaseLifecycleSupport<Solution_> phaseLifecycleSupport 
 - 
assertStepScoreFromScratchprotected boolean assertStepScoreFromScratch 
 - 
assertExpectedStepScoreprotected boolean assertExpectedStepScore 
 - 
assertShadowVariablesAreNotStaleAfterStepprotected boolean assertShadowVariablesAreNotStaleAfterStep 
 
- 
 - 
Constructor Detail- 
AbstractPhasepublic AbstractPhase(int phaseIndex, String logIndentation, BestSolutionRecaller<Solution_> bestSolutionRecaller, Termination<Solution_> termination)
 
- 
 - 
Method Detail- 
getPhaseIndexpublic int getPhaseIndex() 
 - 
getTerminationpublic Termination<Solution_> getTermination() 
 - 
setSolverPhaseLifecycleSupportpublic void setSolverPhaseLifecycleSupport(PhaseLifecycleSupport<Solution_> solverPhaseLifecycleSupport) Description copied from interface:PhaseUsed to makeAbstractSolver.addPhaseLifecycleListener(PhaseLifecycleListener)work.- Specified by:
- setSolverPhaseLifecycleSupportin interface- Phase<Solution_>
- Parameters:
- solverPhaseLifecycleSupport- never null
 
 - 
isAssertStepScoreFromScratchpublic boolean isAssertStepScoreFromScratch() 
 - 
setAssertStepScoreFromScratchpublic void setAssertStepScoreFromScratch(boolean assertStepScoreFromScratch) 
 - 
isAssertExpectedStepScorepublic boolean isAssertExpectedStepScore() 
 - 
setAssertExpectedStepScorepublic void setAssertExpectedStepScore(boolean assertExpectedStepScore) 
 - 
isAssertShadowVariablesAreNotStaleAfterSteppublic boolean isAssertShadowVariablesAreNotStaleAfterStep() 
 - 
setAssertShadowVariablesAreNotStaleAfterSteppublic void setAssertShadowVariablesAreNotStaleAfterStep(boolean assertShadowVariablesAreNotStaleAfterStep) 
 - 
getPhaseTypeStringpublic abstract String getPhaseTypeString() 
 - 
solvingStartedpublic void solvingStarted(SolverScope<Solution_> solverScope) - Specified by:
- solvingStartedin interface- SolverLifecycleListener<Solution_>
 
 - 
solvingEndedpublic void solvingEnded(SolverScope<Solution_> solverScope) - Specified by:
- solvingEndedin interface- SolverLifecycleListener<Solution_>
 
 - 
phaseStartedpublic void phaseStarted(AbstractPhaseScope<Solution_> phaseScope) - Specified by:
- phaseStartedin interface- PhaseLifecycleListener<Solution_>
 
 - 
stepStartedpublic void stepStarted(AbstractStepScope<Solution_> stepScope) - 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) 
 - 
stepEndedpublic void stepEnded(AbstractStepScope<Solution_> stepScope) - Specified by:
- stepEndedin interface- PhaseLifecycleListener<Solution_>
 
 - 
phaseEndedpublic void phaseEnded(AbstractPhaseScope<Solution_> phaseScope) - Specified by:
- phaseEndedin interface- PhaseLifecycleListener<Solution_>
 
 - 
addPhaseLifecycleListenerpublic void addPhaseLifecycleListener(PhaseLifecycleListener<Solution_> phaseLifecycleListener) Description copied from interface:PhaseAdd aPhaseLifecycleListenerthat is only notified of thephaseand thePhaseLifecycleListener.stepStarted(AbstractStepScope)step} starting/ending events from this phase (and theSolverLifecycleListener.solvingStarted(SolverScope)solving} events too of course).To get notified for all phases, use AbstractSolver.addPhaseLifecycleListener(PhaseLifecycleListener)instead.- Specified by:
- addPhaseLifecycleListenerin interface- Phase<Solution_>
- Parameters:
- phaseLifecycleListener- never null
 
 - 
removePhaseLifecycleListenerpublic void removePhaseLifecycleListener(PhaseLifecycleListener<Solution_> phaseLifecycleListener) - Specified by:
- removePhaseLifecycleListenerin interface- Phase<Solution_>
- Parameters:
- phaseLifecycleListener- never null
- See Also:
- Phase.addPhaseLifecycleListener(PhaseLifecycleListener)
 
 - 
assertWorkingSolutionInitializedprotected void assertWorkingSolutionInitialized(AbstractPhaseScope<Solution_> phaseScope) 
 
- 
 
-