Score_
- the Score
typepublic abstract class AbstractScoreHolder<Score_ extends Score> extends Object implements ScoreHolder<Score_>, Serializable
ScoreHolder
.Modifier and Type | Class and Description |
---|---|
class |
AbstractScoreHolder.ConstraintActivationUnMatchListener |
Modifier and Type | Field and Description |
---|---|
protected boolean |
constraintMatchEnabled |
protected Map<String,ConstraintMatchTotal> |
constraintMatchTotalMap |
protected Map<Object,Indictment> |
indictmentMap |
protected Score |
zeroScore |
Modifier | Constructor and Description |
---|---|
protected |
AbstractScoreHolder(boolean constraintMatchEnabled,
Score zeroScore) |
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. |
protected List<Object> |
extractJustificationList(org.kie.api.runtime.rule.RuleContext kcontext) |
Collection<ConstraintMatchTotal> |
getConstraintMatchTotals()
Explains the
Score of ScoreHolder.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 . |
protected void |
registerConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext,
Runnable constraintUndoListener,
Supplier<Score> scoreSupplier) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
extractScore
protected final boolean constraintMatchEnabled
protected final Map<String,ConstraintMatchTotal> constraintMatchTotalMap
protected final Map<Object,Indictment> indictmentMap
protected final Score zeroScore
protected AbstractScoreHolder(boolean constraintMatchEnabled, Score zeroScore)
public boolean isConstraintMatchEnabled()
ScoreHolder
ScoreDirector.isConstraintMatchEnabled()
for the ScoreDirector
which contains this ScoreHolder
.
Defaults to true.
isConstraintMatchEnabled
in interface ScoreHolder<Score_ extends Score>
ConstraintMatch
s and ConstraintMatchTotal
s do not need to be collected
which is a performance boostScoreHolder.getConstraintMatchTotals()
public Collection<ConstraintMatchTotal> getConstraintMatchTotals()
ScoreHolder
Score
of ScoreHolder.extractScore(int)
.
Should not be called directly, use ScoreDirector.getConstraintMatchTotals()
instead.
getConstraintMatchTotals
in interface ScoreHolder<Score_ extends Score>
ScoreDirector.getConstraintMatchTotals()
public Map<Object,Indictment> getIndictmentMap()
ScoreHolder
Score
.
Should not be called directly, use ScoreDirector.getIndictmentMap()
instead.
getIndictmentMap
in interface ScoreHolder<Score_ extends Score>
ScoreDirector.getIndictmentMap()
public void configureConstraintWeight(org.kie.api.definition.rule.Rule rule, Score_ constraintWeight)
ScoreHolder
ConstraintWeight
from the ConstraintConfiguration
during initialization.configureConstraintWeight
in interface ScoreHolder<Score_ extends Score>
rule
- never nullconstraintWeight
- never null, with Score.getInitScore()
equal to 0.protected void registerConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext, Runnable constraintUndoListener, Supplier<Score> scoreSupplier)
Copyright © 2006–2018 JBoss by Red Hat. All rights reserved.