Class AbstractPhaseScope<Solution_>
- java.lang.Object
-
- org.optaplanner.core.impl.phase.scope.AbstractPhaseScope<Solution_>
-
- Type Parameters:
Solution_
- the solution type, the class with thePlanningSolution
annotation
- Direct Known Subclasses:
ConstructionHeuristicPhaseScope
,CustomPhaseScope
,ExhaustiveSearchPhaseScope
,LocalSearchPhaseScope
,PartitionedSearchPhaseScope
public abstract class AbstractPhaseScope<Solution_> extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected int
bestSolutionStepIndex
protected long
childThreadsScoreCalculationCount
protected Long
endingScoreCalculationCount
protected Long
endingSystemTimeMillis
protected org.slf4j.Logger
logger
protected DefaultSolverScope<Solution_>
solverScope
protected Score
startingScore
protected Long
startingScoreCalculationCount
protected Long
startingSystemTimeMillis
-
Constructor Summary
Constructors Constructor Description AbstractPhaseScope(DefaultSolverScope<Solution_> solverScope)
-
Method Summary
-
-
-
Field Detail
-
logger
protected final transient org.slf4j.Logger logger
-
solverScope
protected final DefaultSolverScope<Solution_> solverScope
-
startingSystemTimeMillis
protected Long startingSystemTimeMillis
-
startingScoreCalculationCount
protected Long startingScoreCalculationCount
-
startingScore
protected Score startingScore
-
endingSystemTimeMillis
protected Long endingSystemTimeMillis
-
endingScoreCalculationCount
protected Long endingScoreCalculationCount
-
childThreadsScoreCalculationCount
protected long childThreadsScoreCalculationCount
-
bestSolutionStepIndex
protected int bestSolutionStepIndex
-
-
Constructor Detail
-
AbstractPhaseScope
public AbstractPhaseScope(DefaultSolverScope<Solution_> solverScope)
-
-
Method Detail
-
getSolverScope
public DefaultSolverScope<Solution_> getSolverScope()
-
getStartingSystemTimeMillis
public Long getStartingSystemTimeMillis()
-
getStartingScore
public Score getStartingScore()
-
getEndingSystemTimeMillis
public Long getEndingSystemTimeMillis()
-
getBestSolutionStepIndex
public int getBestSolutionStepIndex()
-
setBestSolutionStepIndex
public void setBestSolutionStepIndex(int bestSolutionStepIndex)
-
getLastCompletedStepScope
public abstract AbstractStepScope<Solution_> getLastCompletedStepScope()
-
reset
public void reset()
-
startingNow
public void startingNow()
-
endingNow
public void endingNow()
-
getSolutionDescriptor
public SolutionDescriptor<Solution_> getSolutionDescriptor()
-
getScoreDefinition
public ScoreDefinition getScoreDefinition()
-
calculateSolverTimeMillisSpentUpToNow
public long calculateSolverTimeMillisSpentUpToNow()
-
calculatePhaseTimeMillisSpentUpToNow
public long calculatePhaseTimeMillisSpentUpToNow()
-
getPhaseTimeMillisSpent
public long getPhaseTimeMillisSpent()
-
addChildThreadsScoreCalculationCount
public void addChildThreadsScoreCalculationCount(long addition)
-
getPhaseScoreCalculationCount
public long getPhaseScoreCalculationCount()
-
getPhaseScoreCalculationSpeed
public long getPhaseScoreCalculationSpeed()
- Returns:
- at least 0, per second
-
getScoreDirector
public InnerScoreDirector<Solution_> getScoreDirector()
-
getWorkingSolution
public Solution_ getWorkingSolution()
-
getWorkingEntityCount
public int getWorkingEntityCount()
-
getWorkingValueCount
public int getWorkingValueCount()
-
calculateScore
public Score calculateScore()
-
assertExpectedWorkingScore
public void assertExpectedWorkingScore(Score expectedWorkingScore, Object completedAction)
-
assertWorkingScoreFromScratch
public void assertWorkingScoreFromScratch(Score workingScore, Object completedAction)
-
assertPredictedScoreFromScratch
public void assertPredictedScoreFromScratch(Score workingScore, Object completedAction)
-
assertShadowVariablesAreNotStale
public void assertShadowVariablesAreNotStale(Score workingScore, Object completedAction)
-
getWorkingRandom
public Random getWorkingRandom()
-
isBestSolutionInitialized
public boolean isBestSolutionInitialized()
-
getBestScore
public Score getBestScore()
-
getPhaseBestSolutionTimeMillis
public long getPhaseBestSolutionTimeMillis()
-
getNextStepIndex
public int getNextStepIndex()
-
-