org.optaplanner.core.impl.score.director.incremental
public class IncrementalScoreDirector extends AbstractScoreDirector<IncrementalScoreDirectorFactory>
ScoreDirector
, which only recalculates the Score
of the part of the Solution
workingSolution that changed,
instead of the going through the entire Solution
. This is incremental calculation, which is fast.ScoreDirector
calculateCount, constraintMatchEnabledPreference, logger, scoreDirectorFactory, trailingEntityMapSupport, variableListenerSupport, workingSolution
Constructor and Description |
---|
IncrementalScoreDirector(IncrementalScoreDirectorFactory scoreDirectorFactory,
IncrementalScoreCalculator incrementalScoreCalculator) |
afterEntityAdded, afterEntityRemoved, afterVariableChanged, appendLegacyConstraintOccurrences, assertExpectedWorkingScore, assertWorkingScoreFromScratch, beforeEntityAdded, beforeEntityRemoved, beforeVariableChanged, clone, cloneWorkingSolution, countWorkingSolutionUninitializedVariables, dispose, getCalculateCount, getConstraintMatchTotals, getScoreDefinition, getScoreDirectorFactory, getSolutionDescriptor, getTrailingEntity, getWorkingEntityCount, getWorkingEntityList, getWorkingSolution, getWorkingValueCount, isConstraintMatchEnabled, isWorkingSolutionInitialized, setCalculatedScore, toString
public IncrementalScoreDirector(IncrementalScoreDirectorFactory scoreDirectorFactory, IncrementalScoreCalculator incrementalScoreCalculator)
public IncrementalScoreCalculator getIncrementalScoreCalculator()
public void setWorkingSolution(Solution workingSolution)
ScoreDirector
workingSolution
must never be the same instance as the bestSolution
,
it should be a (un)changed clone.setWorkingSolution
in interface ScoreDirector
setWorkingSolution
in class AbstractScoreDirector<IncrementalScoreDirectorFactory>
workingSolution
- never nullpublic Score calculateScore()
ScoreDirector
Score
and updates the workingSolution
accordingly.Score
of the workingSolution
public void beforeEntityAdded(PlanningEntityDescriptor entityDescriptor, Object entity)
beforeEntityAdded
in class AbstractScoreDirector<IncrementalScoreDirectorFactory>
public void afterEntityAdded(PlanningEntityDescriptor entityDescriptor, Object entity)
afterEntityAdded
in class AbstractScoreDirector<IncrementalScoreDirectorFactory>
public void beforeVariableChanged(PlanningVariableDescriptor variableDescriptor, Object entity)
beforeVariableChanged
in class AbstractScoreDirector<IncrementalScoreDirectorFactory>
public void afterVariableChanged(PlanningVariableDescriptor variableDescriptor, Object entity)
afterVariableChanged
in class AbstractScoreDirector<IncrementalScoreDirectorFactory>
public void beforeShadowVariableChanged(Object entity, String variableName)
beforeShadowVariableChanged
in class AbstractScoreDirector<IncrementalScoreDirectorFactory>
public void afterShadowVariableChanged(Object entity, String variableName)
afterShadowVariableChanged
in class AbstractScoreDirector<IncrementalScoreDirectorFactory>
public void beforeEntityRemoved(PlanningEntityDescriptor entityDescriptor, Object entity)
beforeEntityRemoved
in class AbstractScoreDirector<IncrementalScoreDirectorFactory>
public void afterEntityRemoved(PlanningEntityDescriptor entityDescriptor, Object entity)
afterEntityRemoved
in class AbstractScoreDirector<IncrementalScoreDirectorFactory>
public void beforeProblemFactAdded(Object problemFact)
beforeProblemFactAdded
in interface ScoreDirector
beforeProblemFactAdded
in class AbstractScoreDirector<IncrementalScoreDirectorFactory>
public void afterProblemFactAdded(Object problemFact)
afterProblemFactAdded
in interface ScoreDirector
afterProblemFactAdded
in class AbstractScoreDirector<IncrementalScoreDirectorFactory>
public void beforeProblemFactChanged(Object problemFact)
beforeProblemFactChanged
in interface ScoreDirector
beforeProblemFactChanged
in class AbstractScoreDirector<IncrementalScoreDirectorFactory>
public void afterProblemFactChanged(Object problemFact)
afterProblemFactChanged
in interface ScoreDirector
afterProblemFactChanged
in class AbstractScoreDirector<IncrementalScoreDirectorFactory>
public void beforeProblemFactRemoved(Object problemFact)
beforeProblemFactRemoved
in interface ScoreDirector
beforeProblemFactRemoved
in class AbstractScoreDirector<IncrementalScoreDirectorFactory>
public void afterProblemFactRemoved(Object problemFact)
afterProblemFactRemoved
in interface ScoreDirector
afterProblemFactRemoved
in class AbstractScoreDirector<IncrementalScoreDirectorFactory>
protected String buildScoreCorruptionAnalysis(ScoreDirector uncorruptedScoreDirector)
buildScoreCorruptionAnalysis
in class AbstractScoreDirector<IncrementalScoreDirectorFactory>
uncorruptedScoreDirector
- never nullCopyright © 2006-2013 JBoss by Red Hat. All Rights Reserved.