OptaPlanner core 6.2.0.Beta1

org.optaplanner.core.impl.score.director.incremental
Interface ConstraintMatchAwareIncrementalScoreCalculator<Sol extends Solution>

Type Parameters:
Sol -
All Superinterfaces:
IncrementalScoreCalculator<Sol>

public interface ConstraintMatchAwareIncrementalScoreCalculator<Sol extends Solution>
extends IncrementalScoreCalculator<Sol>

Allows a IncrementalScoreCalculator to report ConstraintMatchTotals for explaining a score (= which score constraints match for how much) and also for score corruption analysis.

See Also:
IncrementalScoreCalculator

Method Summary
 Collection<ConstraintMatchTotal> getConstraintMatchTotals()
           
 void resetWorkingSolution(Sol workingSolution, boolean constraintMatchEnabled)
          Allows for increased performance by tracking only if constraintMatchEnabled is true.
 
Methods inherited from interface org.optaplanner.core.impl.score.director.incremental.IncrementalScoreCalculator
afterEntityAdded, afterEntityRemoved, afterVariableChanged, beforeEntityAdded, beforeEntityRemoved, beforeVariableChanged, calculateScore, resetWorkingSolution
 

Method Detail

resetWorkingSolution

void resetWorkingSolution(Sol workingSolution,
                          boolean constraintMatchEnabled)
Allows for increased performance by tracking only if constraintMatchEnabled is true.

Every implementation should call IncrementalScoreCalculator.resetWorkingSolution(Solution) and only handle the constraintMatchEnabled parameter specifically (or ignore it).

Parameters:
workingSolution - never null, to pass to IncrementalScoreCalculator.resetWorkingSolution(Solution).
constraintMatchEnabled - true if getConstraintMatchTotals() might be called.

getConstraintMatchTotals

Collection<ConstraintMatchTotal> getConstraintMatchTotals()
Returns:
never null
Throws:
IllegalStateException - if resetWorkingSolution(Solution, boolean)'s constraintMatchEnabled parameter was false
See Also:
ScoreDirector.getConstraintMatchTotals()

OptaPlanner core 6.2.0.Beta1

Copyright © 2006-2014 JBoss by Red Hat. All Rights Reserved.