Solution_
- the solution type, the class with the PlanningSolution
annotationpublic abstract class AbstractPhase<Solution_> extends Object implements Phase<Solution_>
DefaultLocalSearchPhase
Modifier and Type | Field and Description |
---|---|
protected boolean |
assertExpectedStepScore |
protected boolean |
assertShadowVariablesAreNotStaleAfterStep |
protected boolean |
assertStepScoreFromScratch |
protected BestSolutionRecaller<Solution_> |
bestSolutionRecaller |
protected org.slf4j.Logger |
logger |
protected String |
logIndentation |
protected int |
phaseIndex |
protected PhaseLifecycleSupport<Solution_> |
phaseLifecycleSupport
|
protected PhaseLifecycleSupport<Solution_> |
solverPhaseLifecycleSupport
|
protected Termination |
termination |
Constructor and Description |
---|
AbstractPhase(int phaseIndex,
String logIndentation,
BestSolutionRecaller<Solution_> bestSolutionRecaller,
Termination termination) |
protected final transient org.slf4j.Logger logger
protected final int phaseIndex
protected final String logIndentation
protected final BestSolutionRecaller<Solution_> bestSolutionRecaller
protected final Termination termination
protected PhaseLifecycleSupport<Solution_> solverPhaseLifecycleSupport
protected PhaseLifecycleSupport<Solution_> phaseLifecycleSupport
protected boolean assertStepScoreFromScratch
protected boolean assertExpectedStepScore
protected boolean assertShadowVariablesAreNotStaleAfterStep
public AbstractPhase(int phaseIndex, String logIndentation, BestSolutionRecaller<Solution_> bestSolutionRecaller, Termination termination)
public int getPhaseIndex()
public Termination getTermination()
public void setSolverPhaseLifecycleSupport(PhaseLifecycleSupport<Solution_> solverPhaseLifecycleSupport)
Phase
AbstractSolver.addPhaseLifecycleListener(PhaseLifecycleListener)
work.setSolverPhaseLifecycleSupport
in interface Phase<Solution_>
solverPhaseLifecycleSupport
- never nullpublic boolean isAssertStepScoreFromScratch()
public void setAssertStepScoreFromScratch(boolean assertStepScoreFromScratch)
public boolean isAssertExpectedStepScore()
public void setAssertExpectedStepScore(boolean assertExpectedStepScore)
public boolean isAssertShadowVariablesAreNotStaleAfterStep()
public void setAssertShadowVariablesAreNotStaleAfterStep(boolean assertShadowVariablesAreNotStaleAfterStep)
public abstract String getPhaseTypeString()
public void solvingStarted(DefaultSolverScope<Solution_> solverScope)
solvingStarted
in interface SolverLifecycleListener<Solution_>
public void solvingEnded(DefaultSolverScope<Solution_> solverScope)
solvingEnded
in interface SolverLifecycleListener<Solution_>
public void phaseStarted(AbstractPhaseScope<Solution_> phaseScope)
phaseStarted
in interface PhaseLifecycleListener<Solution_>
public void stepStarted(AbstractStepScope<Solution_> stepScope)
stepStarted
in interface PhaseLifecycleListener<Solution_>
protected void calculateWorkingStepScore(AbstractStepScope<Solution_> stepScope, Object completedAction)
protected void predictWorkingStepScore(AbstractStepScope<Solution_> stepScope, Object completedAction)
public void stepEnded(AbstractStepScope<Solution_> stepScope)
stepEnded
in interface PhaseLifecycleListener<Solution_>
public void phaseEnded(AbstractPhaseScope<Solution_> phaseScope)
phaseEnded
in interface PhaseLifecycleListener<Solution_>
public void addPhaseLifecycleListener(PhaseLifecycleListener<Solution_> phaseLifecycleListener)
Phase
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.
addPhaseLifecycleListener
in interface Phase<Solution_>
phaseLifecycleListener
- never nullpublic void removePhaseLifecycleListener(PhaseLifecycleListener<Solution_> phaseLifecycleListener)
removePhaseLifecycleListener
in interface Phase<Solution_>
phaseLifecycleListener
- never nullPhase.addPhaseLifecycleListener(PhaseLifecycleListener)
protected void assertWorkingSolutionInitialized(AbstractPhaseScope<Solution_> phaseScope)
Copyright © 2006–2018 JBoss by Red Hat. All rights reserved.