Package org.optaplanner.core.impl.phase.scope

## Class AbstractPhaseScope<Solution_>

- java.lang.Object
- - org.optaplanner.core.impl.phase.scope.AbstractPhaseScope<Solution_>

- Type Parameters:
    `Solution_` - the solution type, the class with the `PlanningSolution` 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 SolverScope<Solution_>` | `solverScope` |
    `protected Score` | `startingScore` |
    `protected Long` | `startingScoreCalculationCount` |
    `protected Long` | `startingSystemTimeMillis` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AbstractPhaseScope​(SolverScope<Solution_> solverScope)` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addChildThreadsScoreCalculationCount​(long addition)` |
    `<Score_ extends Score<Score_>> void` | `assertExpectedWorkingScore​(Score_ expectedWorkingScore, Object completedAction)` |
    `<Score_ extends Score<Score_>> void` | `assertPredictedScoreFromScratch​(Score_ workingScore, Object completedAction)` |
    `<Score_ extends Score<Score_>> void` | `assertShadowVariablesAreNotStale​(Score_ workingScore, Object completedAction)` |
    `<Score_ extends Score<Score_>> void` | `assertWorkingScoreFromScratch​(Score_ workingScore, Object completedAction)` |
    `long` | `calculatePhaseTimeMillisSpentUpToNow()` |
    `<Score_ extends Score<Score_>> Score_` | `calculateScore()` |
    `long` | `calculateSolverTimeMillisSpentUpToNow()` |
    `void` | `endingNow()` |
    `<Score_ extends Score<Score_>> Score_` | `getBestScore()` |
    `int` | `getBestSolutionStepIndex()` |
    `Long` | `getEndingSystemTimeMillis()` |
    `abstract AbstractStepScope<Solution_>` | `getLastCompletedStepScope()` |
    `int` | `getNextStepIndex()` |
    `long` | `getPhaseBestSolutionTimeMillis()` |
    `long` | `getPhaseScoreCalculationCount()` |
    `long` | `getPhaseScoreCalculationSpeed()` |
    `long` | `getPhaseTimeMillisSpent()` |
    `<Score_ extends Score<Score_>> ScoreDefinition<Score_>` | `getScoreDefinition()` |
    `<Score_ extends Score<Score_>> InnerScoreDirector<Solution_,​Score_>` | `getScoreDirector()` |
    `SolutionDescriptor<Solution_>` | `getSolutionDescriptor()` |
    `SolverScope<Solution_>` | `getSolverScope()` |
    `<Score_ extends Score<Score_>> Score_` | `getStartingScore()` |
    `Long` | `getStartingSystemTimeMillis()` |
    `int` | `getWorkingEntityCount()` |
    `List<Object>` | `getWorkingEntityList()` |
    `Random` | `getWorkingRandom()` |
    `Solution_` | `getWorkingSolution()` |
    `int` | `getWorkingValueCount()` |
    `boolean` | `isBestSolutionInitialized()` |
    `void` | `reset()` |
    `void` | `setBestSolutionStepIndex​(int bestSolutionStepIndex)` |
    `void` | `startingNow()` |
    `String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### logger

          protected final transient org.slf4j.Logger logger

    - #### solverScope

          protected final SolverScope<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​(SolverScope<Solution_> solverScope)

  - ### Method Detail

    - #### getSolverScope

          public SolverScope<Solution_> getSolverScope()

    - #### getStartingSystemTimeMillis

          public Long getStartingSystemTimeMillis()

    - #### getStartingScore

          public <Score_ extends Score<Score_>> 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 <Score_ extends Score<Score_>> ScoreDefinition<Score_> 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 <Score_ extends Score<Score_>> InnerScoreDirector<Solution_,​Score_> getScoreDirector()

    - #### getWorkingSolution

          public Solution_ getWorkingSolution()

    - #### getWorkingEntityCount

          public int getWorkingEntityCount()

    - #### getWorkingEntityList

          public List<Object> getWorkingEntityList()

    - #### getWorkingValueCount

          public int getWorkingValueCount()

    - #### calculateScore

          public <Score_ extends Score<Score_>> Score_ calculateScore()

    - #### assertExpectedWorkingScore

          public <Score_ extends Score<Score_>> void assertExpectedWorkingScore​(Score_ expectedWorkingScore,
                                                                                Object completedAction)

    - #### assertWorkingScoreFromScratch

          public <Score_ extends Score<Score_>> void assertWorkingScoreFromScratch​(Score_ workingScore,
                                                                                   Object completedAction)

    - #### assertPredictedScoreFromScratch

          public <Score_ extends Score<Score_>> void assertPredictedScoreFromScratch​(Score_ workingScore,
                                                                                     Object completedAction)

    - #### assertShadowVariablesAreNotStale

          public <Score_ extends Score<Score_>> void assertShadowVariablesAreNotStale​(Score_ workingScore,
                                                                                      Object completedAction)

    - #### getWorkingRandom

          public Random getWorkingRandom()

    - #### isBestSolutionInitialized

          public boolean isBestSolutionInitialized()

    - #### getBestScore

          public <Score_ extends Score<Score_>> Score_ getBestScore()

    - #### getPhaseBestSolutionTimeMillis

          public long getPhaseBestSolutionTimeMillis()

    - #### getNextStepIndex

          public int getNextStepIndex()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`