Class DefaultLocalSearchPhase<Solution_>
java.lang.Object
org.optaplanner.core.impl.phase.AbstractPhase<Solution_>
org.optaplanner.core.impl.localsearch.DefaultLocalSearchPhase<Solution_>
- Type Parameters:
Solution_
- the solution type, the class with thePlanningSolution
annotation
- All Implemented Interfaces:
EventListener
,LocalSearchPhaseLifecycleListener<Solution_>
,LocalSearchPhase<Solution_>
,PhaseLifecycleListener<Solution_>
,Phase<Solution_>
,SolverLifecycleListener<Solution_>
public class DefaultLocalSearchPhase<Solution_>
extends AbstractPhase<Solution_>
implements LocalSearchPhase<Solution_>, LocalSearchPhaseLifecycleListener<Solution_>
Default implementation of
LocalSearchPhase
.-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AtomicLong
protected final Map<io.micrometer.core.instrument.Tags,
List<AtomicReference<Number>>> protected final Map<io.micrometer.core.instrument.Tags,
List<AtomicReference<Number>>> protected final Map<io.micrometer.core.instrument.Tags,
AtomicLong> protected final Map<io.micrometer.core.instrument.Tags,
AtomicLong> protected final LocalSearchDecider<Solution_>
protected final AtomicLong
Fields inherited from class org.optaplanner.core.impl.phase.AbstractPhase
assertExpectedStepScore, assertShadowVariablesAreNotStaleAfterStep, assertStepScoreFromScratch, logger, logIndentation, phaseIndex, phaseLifecycleSupport, phaseTermination, solver
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doStep
(LocalSearchStepScope<Solution_> stepScope) void
phaseEnded
(LocalSearchPhaseScope<Solution_> phaseScope) void
phaseStarted
(LocalSearchPhaseScope<Solution_> phaseScope) void
solve
(SolverScope<Solution_> solverScope) void
solvingEnded
(SolverScope<Solution_> solverScope) void
solvingError
(SolverScope<Solution_> solverScope, Exception exception) Invoked in case of an exception in theSolver
run.void
solvingStarted
(SolverScope<Solution_> solverScope) void
stepEnded
(LocalSearchStepScope<Solution_> stepScope) void
stepStarted
(LocalSearchStepScope<Solution_> stepScope) Methods inherited from class org.optaplanner.core.impl.phase.AbstractPhase
addPhaseLifecycleListener, assertWorkingSolutionInitialized, calculateWorkingStepScore, getPhaseIndex, getPhaseTermination, getSolver, isAssertExpectedStepScore, isAssertShadowVariablesAreNotStaleAfterStep, isAssertStepScoreFromScratch, phaseEnded, phaseStarted, predictWorkingStepScore, removePhaseLifecycleListener, setSolver, stepEnded, stepStarted
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.phase.Phase
addPhaseLifecycleListener, removePhaseLifecycleListener
Methods inherited from interface org.optaplanner.core.impl.phase.event.PhaseLifecycleListener
phaseEnded, phaseStarted, stepEnded, stepStarted
-
Field Details
-
decider
-
acceptedMoveCountPerStep
-
selectedMoveCountPerStep
-
constraintMatchTotalTagsToStepCount
protected final Map<io.micrometer.core.instrument.Tags,AtomicLong> constraintMatchTotalTagsToStepCount -
constraintMatchTotalTagsToBestCount
protected final Map<io.micrometer.core.instrument.Tags,AtomicLong> constraintMatchTotalTagsToBestCount -
constraintMatchTotalStepScoreMap
protected final Map<io.micrometer.core.instrument.Tags,List<AtomicReference<Number>>> constraintMatchTotalStepScoreMap -
constraintMatchTotalBestScoreMap
protected final Map<io.micrometer.core.instrument.Tags,List<AtomicReference<Number>>> constraintMatchTotalBestScoreMap
-
-
Method Details
-
getPhaseTypeString
- Specified by:
getPhaseTypeString
in classAbstractPhase<Solution_>
-
solve
-
doStep
-
solvingStarted
- Specified by:
solvingStarted
in interfaceSolverLifecycleListener<Solution_>
- Overrides:
solvingStarted
in classAbstractPhase<Solution_>
-
phaseStarted
- Specified by:
phaseStarted
in interfaceLocalSearchPhaseLifecycleListener<Solution_>
-
stepStarted
- Specified by:
stepStarted
in interfaceLocalSearchPhaseLifecycleListener<Solution_>
-
stepEnded
- Specified by:
stepEnded
in interfaceLocalSearchPhaseLifecycleListener<Solution_>
-
phaseEnded
- Specified by:
phaseEnded
in interfaceLocalSearchPhaseLifecycleListener<Solution_>
-
solvingEnded
- Specified by:
solvingEnded
in interfaceSolverLifecycleListener<Solution_>
- Overrides:
solvingEnded
in classAbstractPhase<Solution_>
-
solvingError
Description copied from interface:SolverLifecycleListener
Invoked in case of an exception in theSolver
run. In that case, theSolverLifecycleListener.solvingEnded(SolverScope)
is never called. For internal purposes only.- Specified by:
solvingError
in interfaceSolverLifecycleListener<Solution_>
-