Score_
- the Score
typepublic interface ScoreHolder<Score_ extends Score<Score_>>
DroolsScoreDirector
into the Drools DRL.
Other ScoreDirector
implementations do not use this class.
An implementation must extend AbstractScoreHolder
to ensure backwards compatibility in future versions.
AbstractScoreHolder
Modifier and Type | Method and Description |
---|---|
void |
configureConstraintWeight(org.kie.api.definition.rule.Rule rule,
Score_ constraintWeight)
Sets up a
ConstraintWeight from the ConstraintConfiguration during initialization. |
Score_ |
extractScore(int initScore)
|
Map<String,ConstraintMatchTotal> |
getConstraintMatchTotalMap()
Explains the
Score of extractScore(int) . |
Collection<ConstraintMatchTotal> |
getConstraintMatchTotals()
Explains the
Score of extractScore(int) . |
Map<Object,Indictment> |
getIndictmentMap()
Explains the impact of each planning entity or problem fact on the
Score . |
boolean |
isConstraintMatchEnabled()
Must be in sync with
ScoreDirector.isConstraintMatchEnabled()
for the ScoreDirector which contains this ScoreHolder . |
Score_ extractScore(int initScore)
Score
, calculated by the KieSession
for DroolsScoreDirector
.
Should not be called directly, use ScoreDirector.calculateScore()
instead.
initScore
- <= 0
, managed by OptaPlanner, needed as a parameter in the Score
's creation
method, see Score.getInitScore()
Score
of the working PlanningSolution
void configureConstraintWeight(org.kie.api.definition.rule.Rule rule, Score_ constraintWeight)
ConstraintWeight
from the ConstraintConfiguration
during initialization.rule
- never nullconstraintWeight
- never null, with Score.getInitScore()
equal to 0.boolean isConstraintMatchEnabled()
ScoreDirector.isConstraintMatchEnabled()
for the ScoreDirector
which contains this ScoreHolder
.
Defaults to true.
ConstraintMatch
s and ConstraintMatchTotal
s do not need to be collected
which is a performance boostgetConstraintMatchTotals()
Collection<ConstraintMatchTotal> getConstraintMatchTotals()
Score
of extractScore(int)
.
Should not be called directly, use ScoreDirector.getConstraintMatchTotals()
instead.
IllegalStateException
- if isConstraintMatchEnabled()
is falseScoreDirector.getConstraintMatchTotals()
Map<String,ConstraintMatchTotal> getConstraintMatchTotalMap()
Score
of extractScore(int)
.
Should not be called directly, use ScoreDirector.getConstraintMatchTotalMap()
instead.
IllegalStateException
- if isConstraintMatchEnabled()
is falseScoreDirector.getConstraintMatchTotalMap()
Map<Object,Indictment> getIndictmentMap()
Score
.
Should not be called directly, use ScoreDirector.getIndictmentMap()
instead.
IllegalStateException
- if isConstraintMatchEnabled()
returns falseScoreDirector.getIndictmentMap()
Copyright © 2006–2020 JBoss by Red Hat. All rights reserved.