Class AbstractPhaseScope<Solution_>
java.lang.Object
ai.timefold.solver.core.impl.phase.scope.AbstractPhaseScope<Solution_>
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotation
- Direct Known Subclasses:
ConstructionHeuristicPhaseScope,CustomPhaseScope,ExhaustiveSearchPhaseScope,LocalSearchPhaseScope
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected longprotected Longprotected Longprotected Longprotected final org.slf4j.Loggerprotected final intprotected final booleanprotected final SolverScope<Solution_>protected Longprotected InnerScore<?>protected Longprotected Long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractPhaseScope(SolverScope<Solution_> solverScope, int phaseIndex) As defined by #AbstractPhaseScope(SolverScope, int, boolean) with the phaseSendingBestSolutionEvents parameter set to true.protectedAbstractPhaseScope(SolverScope<Solution_> solverScope, int phaseIndex, boolean phaseSendingBestSolutionEvents) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChildThreadsScoreCalculationCount(long addition) voidaddMoveEvaluationCount(Move<Solution_> move, long count) voidaddMoveEvaluationCountPerType(Move<Solution_> move, long count) <Score_ extends Score<Score_>>
voidassertExpectedWorkingScore(InnerScore<Score_> expectedWorkingScore, Object completedAction) <Score_ extends Score<Score_>>
voidassertPredictedScoreFromScratch(InnerScore<Score_> workingScore, Object completedAction) <Score_ extends Score<Score_>>
voidassertShadowVariablesAreNotStale(InnerScore<Score_> workingScore, Object completedAction) <Score_ extends Score<Score_>>
voidassertWorkingScoreFromScratch(InnerScore<Score_> workingScore, Object completedAction) long<Score_ extends Score<Score_>>
InnerScore<Score_>longvoid<Score_ extends Score<Score_>>
InnerScore<Score_>intabstract AbstractStepScope<Solution_>intlongintlonglonglonglonglong<Score_ extends Score<Score_>>
InnerScoreDirector<Solution_,Score_> <Score_ extends Score<Score_>>
InnerScore<Score_>intbooleanbooleanvoidreset()voidsetBestSolutionStepIndex(int bestSolutionStepIndex) voidsetTermination(PhaseTermination<Solution_> termination) voidtoString()
-
Field Details
-
logger
protected final transient org.slf4j.Logger logger -
solverScope
-
phaseIndex
protected final int phaseIndex -
phaseSendingBestSolutionEvents
protected final boolean phaseSendingBestSolutionEvents -
startingSystemTimeMillis
-
startingScoreCalculationCount
-
startingMoveEvaluationCount
-
startingScore
-
endingSystemTimeMillis
-
endingScoreCalculationCount
-
endingMoveEvaluationCount
-
childThreadsScoreCalculationCount
protected long childThreadsScoreCalculationCount -
bestSolutionStepIndex
protected int bestSolutionStepIndex
-
-
Constructor Details
-
AbstractPhaseScope
As defined by #AbstractPhaseScope(SolverScope, int, boolean) with the phaseSendingBestSolutionEvents parameter set to true. -
AbstractPhaseScope
protected AbstractPhaseScope(SolverScope<Solution_> solverScope, int phaseIndex, boolean phaseSendingBestSolutionEvents) - Parameters:
solverScope- never nullphaseIndex- the index of the phase, >= 0phaseSendingBestSolutionEvents- set to false if the phase only sends one best solution event at the end, or none at all; this is typical for construction heuristics, whose result only matters when it reached its natural end.
-
-
Method Details
-
getSolverScope
-
getPhaseIndex
public int getPhaseIndex() -
isPhaseSendingBestSolutionEvents
public boolean isPhaseSendingBestSolutionEvents() -
getStartingSystemTimeMillis
-
getStartingScore
-
getEndingSystemTimeMillis
-
getBestSolutionStepIndex
public int getBestSolutionStepIndex() -
setBestSolutionStepIndex
public void setBestSolutionStepIndex(int bestSolutionStepIndex) -
getLastCompletedStepScope
-
reset
public void reset() -
startingNow
public void startingNow() -
endingNow
public void endingNow() -
getSolutionDescriptor
-
calculateSolverTimeMillisSpentUpToNow
public long calculateSolverTimeMillisSpentUpToNow() -
calculatePhaseTimeMillisSpentUpToNow
public long calculatePhaseTimeMillisSpentUpToNow() -
getPhaseTimeMillisSpent
public long getPhaseTimeMillisSpent() -
addChildThreadsScoreCalculationCount
public void addChildThreadsScoreCalculationCount(long addition) -
addMoveEvaluationCount
-
addMoveEvaluationCountPerType
-
getPhaseScoreCalculationCount
public long getPhaseScoreCalculationCount() -
getPhaseMoveEvaluationCount
public long getPhaseMoveEvaluationCount() -
getPhaseScoreCalculationSpeed
public long getPhaseScoreCalculationSpeed()- Returns:
- at least 0, per second
-
getPhaseMoveEvaluationSpeed
public long getPhaseMoveEvaluationSpeed()- Returns:
- at least 0, per second
-
getScoreDirector
-
setTermination
-
getTermination
-
getWorkingSolution
-
getWorkingEntityCount
public int getWorkingEntityCount() -
calculateScore
-
assertExpectedWorkingScore
public <Score_ extends Score<Score_>> void assertExpectedWorkingScore(InnerScore<Score_> expectedWorkingScore, Object completedAction) -
assertWorkingScoreFromScratch
public <Score_ extends Score<Score_>> void assertWorkingScoreFromScratch(InnerScore<Score_> workingScore, Object completedAction) -
assertPredictedScoreFromScratch
public <Score_ extends Score<Score_>> void assertPredictedScoreFromScratch(InnerScore<Score_> workingScore, Object completedAction) -
assertShadowVariablesAreNotStale
public <Score_ extends Score<Score_>> void assertShadowVariablesAreNotStale(InnerScore<Score_> workingScore, Object completedAction) -
getWorkingRandom
-
isBestSolutionInitialized
public boolean isBestSolutionInitialized() -
getBestScore
-
getPhaseBestSolutionTimeMillis
public long getPhaseBestSolutionTimeMillis() -
getNextStepIndex
public int getNextStepIndex() -
toString
-