org.drools.planner.core.score.director.incremental
Class IncrementalScoreDirector
java.lang.Object
org.drools.planner.core.score.director.AbstractScoreDirector<IncrementalScoreDirectorFactory>
org.drools.planner.core.score.director.incremental.IncrementalScoreDirector
- All Implemented Interfaces:
- ScoreDirector
public class IncrementalScoreDirector
- extends AbstractScoreDirector<IncrementalScoreDirectorFactory>
Incremental java implementation of 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.
- See Also:
ScoreDirector
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IncrementalScoreDirector
public IncrementalScoreDirector(IncrementalScoreDirectorFactory scoreDirectorFactory,
IncrementalScoreCalculator incrementalScoreCalculator)
setWorkingSolution
public void setWorkingSolution(Solution workingSolution)
- Description copied from interface:
ScoreDirector
- The workingSolution must never be the same instance as the bestSolution, it should be a (un)changed clone.
- Parameters:
workingSolution
- never null
beforeEntityAdded
public void beforeEntityAdded(Object entity)
afterEntityAdded
public void afterEntityAdded(Object entity)
beforeAllVariablesChanged
public void beforeAllVariablesChanged(Object entity)
afterAllVariablesChanged
public void afterAllVariablesChanged(Object entity)
beforeVariableChanged
public void beforeVariableChanged(Object entity,
String variableName)
afterVariableChanged
public void afterVariableChanged(Object entity,
String variableName)
beforeEntityRemoved
public void beforeEntityRemoved(Object entity)
afterEntityRemoved
public void afterEntityRemoved(Object entity)
beforeProblemFactAdded
public void beforeProblemFactAdded(Object problemFact)
afterProblemFactAdded
public void afterProblemFactAdded(Object problemFact)
beforeProblemFactChanged
public void beforeProblemFactChanged(Object problemFact)
afterProblemFactChanged
public void afterProblemFactChanged(Object problemFact)
beforeProblemFactRemoved
public void beforeProblemFactRemoved(Object problemFact)
afterProblemFactRemoved
public void afterProblemFactRemoved(Object problemFact)
calculateScore
public Score calculateScore()
- Description copied from interface:
ScoreDirector
- Calculates the
Score
and updates the workingSolution accordingly.
- Returns:
- never null, the
Score
of the working solution
dispose
public void dispose()
- Description copied from interface:
ScoreDirector
- Needs to be called after use because some implementations needs to clean up their resources.
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.