Class BestSolutionRecaller<Solution_>
- java.lang.Object
-
- org.optaplanner.core.impl.solver.event.SolverLifecycleListenerAdapter<Solution_>
-
- org.optaplanner.core.impl.phase.event.PhaseLifecycleListenerAdapter<Solution_>
-
- org.optaplanner.core.impl.solver.recaller.BestSolutionRecaller<Solution_>
-
- Type Parameters:
Solution_
- the solution type, the class with thePlanningSolution
annotation
- All Implemented Interfaces:
EventListener
,PhaseLifecycleListener<Solution_>
,SolverLifecycleListener<Solution_>
public class BestSolutionRecaller<Solution_> extends PhaseLifecycleListenerAdapter<Solution_>
Remembers thebest solution
that aSolver
encounters.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
assertBestScoreIsUnmodified
protected boolean
assertInitialScoreFromScratch
protected boolean
assertShadowVariablesAreNotStale
protected SolverEventSupport<Solution_>
solverEventSupport
-
Constructor Summary
Constructors Constructor Description BestSolutionRecaller()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
processWorkingSolutionDuringConstructionHeuristicsStep(AbstractStepScope<Solution_> stepScope)
void
processWorkingSolutionDuringMove(Score score, AbstractStepScope<Solution_> stepScope)
void
processWorkingSolutionDuringStep(AbstractStepScope<Solution_> stepScope)
void
setAssertBestScoreIsUnmodified(boolean assertBestScoreIsUnmodified)
void
setAssertInitialScoreFromScratch(boolean assertInitialScoreFromScratch)
void
setAssertShadowVariablesAreNotStale(boolean assertShadowVariablesAreNotStale)
void
setSolverEventSupport(SolverEventSupport<Solution_> solverEventSupport)
void
solvingStarted(SolverScope<Solution_> solverScope)
void
updateBestSolutionAndFire(SolverScope<Solution_> solverScope)
void
updateBestSolutionWithoutFiring(SolverScope<Solution_> solverScope)
-
Methods inherited from class org.optaplanner.core.impl.phase.event.PhaseLifecycleListenerAdapter
phaseEnded, phaseStarted, stepEnded, stepStarted
-
Methods inherited from class org.optaplanner.core.impl.solver.event.SolverLifecycleListenerAdapter
solvingEnded
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.optaplanner.core.impl.solver.event.SolverLifecycleListener
solvingEnded
-
-
-
-
Field Detail
-
assertInitialScoreFromScratch
protected boolean assertInitialScoreFromScratch
-
assertShadowVariablesAreNotStale
protected boolean assertShadowVariablesAreNotStale
-
assertBestScoreIsUnmodified
protected boolean assertBestScoreIsUnmodified
-
solverEventSupport
protected SolverEventSupport<Solution_> solverEventSupport
-
-
Method Detail
-
setAssertInitialScoreFromScratch
public void setAssertInitialScoreFromScratch(boolean assertInitialScoreFromScratch)
-
setAssertShadowVariablesAreNotStale
public void setAssertShadowVariablesAreNotStale(boolean assertShadowVariablesAreNotStale)
-
setAssertBestScoreIsUnmodified
public void setAssertBestScoreIsUnmodified(boolean assertBestScoreIsUnmodified)
-
setSolverEventSupport
public void setSolverEventSupport(SolverEventSupport<Solution_> solverEventSupport)
-
solvingStarted
public void solvingStarted(SolverScope<Solution_> solverScope)
- Specified by:
solvingStarted
in interfaceSolverLifecycleListener<Solution_>
- Overrides:
solvingStarted
in classSolverLifecycleListenerAdapter<Solution_>
-
processWorkingSolutionDuringConstructionHeuristicsStep
public void processWorkingSolutionDuringConstructionHeuristicsStep(AbstractStepScope<Solution_> stepScope)
-
processWorkingSolutionDuringStep
public void processWorkingSolutionDuringStep(AbstractStepScope<Solution_> stepScope)
-
processWorkingSolutionDuringMove
public void processWorkingSolutionDuringMove(Score score, AbstractStepScope<Solution_> stepScope)
-
updateBestSolutionAndFire
public void updateBestSolutionAndFire(SolverScope<Solution_> solverScope)
-
updateBestSolutionWithoutFiring
public void updateBestSolutionWithoutFiring(SolverScope<Solution_> solverScope)
-
-