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.ScoreDirectorallChangesWillBeUndoneBeforeStepEnds, calculateCount, constraintMatchEnabledPreference, logger, scoreDirectorFactory, variableListenerSupport, workingEntityListRevision, workingSolution| Constructor and Description |
|---|
IncrementalScoreDirector(IncrementalScoreDirectorFactory scoreDirectorFactory,
boolean constraintMatchEnabledPreference,
IncrementalScoreCalculator incrementalScoreCalculator) |
afterEntityAdded, afterEntityRemoved, afterVariableChanged, assertExpectedWorkingScore, assertShadowVariablesAreNotStale, assertWorkingScoreFromScratch, beforeEntityAdded, beforeEntityRemoved, beforeVariableChanged, buildScoreCorruptionAnalysis, changeVariableFacade, clone, cloneSolution, cloneWorkingSolution, countWorkingSolutionUninitializedVariables, dispose, getCalculateCount, getScoreDefinition, getScoreDirectorFactory, getSolutionDescriptor, getSupplyManager, getWorkingEntityCount, getWorkingEntityList, getWorkingEntityListRevision, getWorkingSolution, getWorkingValueCount, isAllChangesWillBeUndoneBeforeStepEnds, isWorkingEntityListDirty, resetCalculateCount, setAllChangesWillBeUndoneBeforeStepEnds, setCalculatedScore, setWorkingEntityListDirty, toString, triggerVariableListenerspublic IncrementalScoreDirector(IncrementalScoreDirectorFactory scoreDirectorFactory, boolean constraintMatchEnabledPreference, IncrementalScoreCalculator incrementalScoreCalculator)
public IncrementalScoreCalculator getIncrementalScoreCalculator()
public void setWorkingSolution(Solution workingSolution)
ScoreDirectorworkingSolution must never be the same instance as the bestSolution,
it should be a (un)changed clone.
Only call this method on a separate ScoreDirector instance,
build by Solver.getScoreDirectorFactory(),
not on the one used inside the Solver itself.
setWorkingSolution in interface ScoreDirectorsetWorkingSolution in class AbstractScoreDirector<IncrementalScoreDirectorFactory>workingSolution - never nullpublic Score calculateScore()
ScoreDirectorScore and updates the workingSolution accordingly.Score of the workingSolutionpublic boolean isConstraintMatchEnabled()
ScoreDirector.getConstraintMatchTotals() can be calledpublic Collection<ConstraintMatchTotal> getConstraintMatchTotals()
public void beforeEntityAdded(EntityDescriptor entityDescriptor, Object entity)
beforeEntityAdded in class AbstractScoreDirector<IncrementalScoreDirectorFactory>public void afterEntityAdded(EntityDescriptor entityDescriptor, Object entity)
afterEntityAdded in class AbstractScoreDirector<IncrementalScoreDirectorFactory>public void beforeVariableChanged(VariableDescriptor variableDescriptor, Object entity)
beforeVariableChanged in interface ScoreDirectorbeforeVariableChanged in class AbstractScoreDirector<IncrementalScoreDirectorFactory>public void afterVariableChanged(VariableDescriptor variableDescriptor, Object entity)
afterVariableChanged in interface ScoreDirectorafterVariableChanged in class AbstractScoreDirector<IncrementalScoreDirectorFactory>public void beforeEntityRemoved(EntityDescriptor entityDescriptor, Object entity)
beforeEntityRemoved in class AbstractScoreDirector<IncrementalScoreDirectorFactory>public void afterEntityRemoved(EntityDescriptor entityDescriptor, Object entity)
afterEntityRemoved in class AbstractScoreDirector<IncrementalScoreDirectorFactory>public void beforeProblemFactAdded(Object problemFact)
beforeProblemFactAdded in interface ScoreDirectorbeforeProblemFactAdded in class AbstractScoreDirector<IncrementalScoreDirectorFactory>public void afterProblemFactAdded(Object problemFact)
afterProblemFactAdded in interface ScoreDirectorafterProblemFactAdded in class AbstractScoreDirector<IncrementalScoreDirectorFactory>public void beforeProblemFactChanged(Object problemFact)
beforeProblemFactChanged in interface ScoreDirectorbeforeProblemFactChanged in class AbstractScoreDirector<IncrementalScoreDirectorFactory>public void afterProblemFactChanged(Object problemFact)
afterProblemFactChanged in interface ScoreDirectorafterProblemFactChanged in class AbstractScoreDirector<IncrementalScoreDirectorFactory>public void beforeProblemFactRemoved(Object problemFact)
beforeProblemFactRemoved in interface ScoreDirectorbeforeProblemFactRemoved in class AbstractScoreDirector<IncrementalScoreDirectorFactory>public void afterProblemFactRemoved(Object problemFact)
afterProblemFactRemoved in interface ScoreDirectorafterProblemFactRemoved in class AbstractScoreDirector<IncrementalScoreDirectorFactory>Copyright © 2006–2016 JBoss by Red Hat. All rights reserved.