OptaPlanner core 6.0.1.Final

org.optaplanner.core.api.score.holder
Interface ScoreHolder

All Known Implementing Classes:
AbstractScoreHolder, BendableScoreHolder, HardMediumSoftScoreHolder, HardSoftBigDecimalScoreHolder, HardSoftDoubleScoreHolder, HardSoftLongScoreHolder, HardSoftScoreHolder, SimpleBigDecimalScoreHolder, SimpleDoubleScoreHolder, SimpleLongScoreHolder, SimpleScoreHolder

public interface ScoreHolder

This class is injected as a global by DroolsScoreDirector into the Drools DRL. Other ScoreDirector implementations do not use this class.

See Also:
AbstractScoreHolder

Method Summary
 Score extractScore()
          Extracts the Score, calculated by the KieSession for DroolsScoreDirector.
 Collection<ConstraintMatchTotal> getConstraintMatchTotals()
          Explains the Score of extractScore().
 boolean isConstraintMatchEnabled()
          Must be in sync with ScoreDirector.isConstraintMatchEnabled() for the ScoreDirector which contains this ScoreHolder.
 

Method Detail

extractScore

Score extractScore()
Extracts the Score, calculated by the KieSession for DroolsScoreDirector.

Should not be called directly, use ScoreDirector.calculateScore() instead.

Returns:
never null, the Score of the working Solution

isConstraintMatchEnabled

boolean isConstraintMatchEnabled()
Must be in sync with ScoreDirector.isConstraintMatchEnabled() for the ScoreDirector which contains this ScoreHolder.

Defaults to true.

Returns:
false if the ConstraintMatchs and ConstraintMatchTotals do not need to be collected which is a performance boost
See Also:
getConstraintMatchTotals()

getConstraintMatchTotals

Collection<ConstraintMatchTotal> getConstraintMatchTotals()
Explains the Score of extractScore().

Returns:
never null
Throws:
RuntimeException - if isConstraintMatchEnabled() is false

OptaPlanner core 6.0.1.Final

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