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
Fields -
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(Score_ expectedWorkingScore, Object completedAction) <Score_ extends Score<Score_>>
voidassertPredictedScoreFromScratch(Score_ workingScore, Object completedAction) <Score_ extends Score<Score_>>
voidassertShadowVariablesAreNotStale(Score_ workingScore, Object completedAction) <Score_ extends Score<Score_>>
voidassertWorkingScoreFromScratch(Score_ workingScore, Object completedAction) long<Score_ extends Score<Score_>>
Score_longvoid<Score_ extends Score<Score_>>
Score_intabstract AbstractStepScope<Solution_>intlongintlonglonglonglonglong<Score_ extends Score<Score_>>
InnerScoreDirector<Solution_,Score_> <Score_ extends Score<Score_>>
Score_intbooleanbooleanvoidreset()voidsetBestSolutionStepIndex(int bestSolutionStepIndex) 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
-
getWorkingSolution
-
getWorkingEntityCount
public int getWorkingEntityCount() -
calculateScore
-
assertExpectedWorkingScore
-
assertWorkingScoreFromScratch
-
assertPredictedScoreFromScratch
-
assertShadowVariablesAreNotStale
-
getWorkingRandom
-
isBestSolutionInitialized
public boolean isBestSolutionInitialized() -
getBestScore
-
getPhaseBestSolutionTimeMillis
public long getPhaseBestSolutionTimeMillis() -
getNextStepIndex
public int getNextStepIndex() -
toString
-