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 thePlanningSolutionannotation
- All Implemented Interfaces:
EventListener,PhaseLifecycleListener<Solution_>,Phase<Solution_>,SolverLifecycleListener<Solution_>
- Direct Known Subclasses:
DefaultConstructionHeuristicPhase,DefaultExhaustiveSearchPhase,DefaultLocalSearchPhase,DefaultPartitionedSearchPhase,NoChangePhase
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier 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 Summary
Constructors -
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).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.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.optaplanner.core.impl.solver.event.SolverLifecycleListener
solvingError
-
Field Details
-
logger
protected final transient org.slf4j.Logger logger -
phaseIndex
protected final int phaseIndex -
logIndentation
-
phaseTermination
-
assertStepScoreFromScratch
protected final boolean assertStepScoreFromScratch -
assertExpectedStepScore
protected final boolean assertExpectedStepScore -
assertShadowVariablesAreNotStaleAfterStep
protected final boolean assertShadowVariablesAreNotStaleAfterStep -
phaseLifecycleSupport
-
solver
-
-
Constructor Details
-
AbstractPhase
-
-
Method Details
-
getPhaseIndex
public int getPhaseIndex() -
getPhaseTermination
-
getSolver
-
setSolver
-
isAssertStepScoreFromScratch
public boolean isAssertStepScoreFromScratch() -
isAssertExpectedStepScore
public boolean isAssertExpectedStepScore() -
isAssertShadowVariablesAreNotStaleAfterStep
public boolean isAssertShadowVariablesAreNotStaleAfterStep() -
getPhaseTypeString
-
solvingStarted
- Specified by:
solvingStartedin interfaceSolverLifecycleListener<Solution_>
-
solvingEnded
- Specified by:
solvingEndedin interfaceSolverLifecycleListener<Solution_>
-
phaseStarted
- Specified by:
phaseStartedin interfacePhaseLifecycleListener<Solution_>
-
phaseEnded
- Specified by:
phaseEndedin interfacePhaseLifecycleListener<Solution_>
-
stepStarted
- Specified by:
stepStartedin interfacePhaseLifecycleListener<Solution_>
-
calculateWorkingStepScore
protected <Score_ extends Score<Score_>> void calculateWorkingStepScore(AbstractStepScope<Solution_> stepScope, Object completedAction) -
predictWorkingStepScore
protected <Score_ extends Score<Score_>> void predictWorkingStepScore(AbstractStepScope<Solution_> stepScope, Object completedAction) -
stepEnded
- Specified by:
stepEndedin interfacePhaseLifecycleListener<Solution_>
-
addPhaseLifecycleListener
Description 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 interfacePhase<Solution_>- Parameters:
phaseLifecycleListener- never null
-
removePhaseLifecycleListener
- Specified by:
removePhaseLifecycleListenerin interfacePhase<Solution_>- Parameters:
phaseLifecycleListener- never null- See Also:
-
assertWorkingSolutionInitialized
-