public class SimpleBigDecimalScoreHolder extends AbstractScoreHolder<SimpleBigDecimalScore>
SimpleBigDecimalScore,
Serialized FormAbstractScoreHolder.ConstraintActivationUnMatchListener| Modifier and Type | Field and Description |
|---|---|
protected Map<org.kie.api.definition.rule.Rule,BiConsumer<org.kie.api.runtime.rule.RuleContext,BigDecimal>> |
matchExecutorByNumberMap |
protected BigDecimal |
score |
constraintMatchEnabled, constraintMatchTotalMap, indictmentMap, zeroScore| Constructor and Description |
|---|
SimpleBigDecimalScoreHolder(boolean constraintMatchEnabled) |
| Modifier and Type | Method and Description |
|---|---|
void |
addConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext,
BigDecimal weight) |
void |
configureConstraintWeight(org.kie.api.definition.rule.Rule rule,
SimpleBigDecimalScore constraintWeight)
Sets up a
ConstraintWeight from the ConstraintConfiguration during initialization. |
SimpleBigDecimalScore |
extractScore(int initScore)
|
BigDecimal |
getScore() |
void |
penalize(org.kie.api.runtime.rule.RuleContext kcontext)
Penalize a match by the
ConstraintWeight negated. |
void |
penalize(org.kie.api.runtime.rule.RuleContext kcontext,
BigDecimal weightMultiplier)
Penalize a match by the
ConstraintWeight negated and multiplied with the weightMultiplier for all score levels. |
void |
reward(org.kie.api.runtime.rule.RuleContext kcontext)
Reward a match by the
ConstraintWeight. |
void |
reward(org.kie.api.runtime.rule.RuleContext kcontext,
BigDecimal weightMultiplier)
Reward a match by the
ConstraintWeight multiplied with the weightMultiplier for all score levels. |
extractJustificationList, getConstraintMatchTotals, getIndictmentMap, isConstraintMatchEnabled, registerConstraintMatchprotected final Map<org.kie.api.definition.rule.Rule,BiConsumer<org.kie.api.runtime.rule.RuleContext,BigDecimal>> matchExecutorByNumberMap
protected BigDecimal score
public SimpleBigDecimalScoreHolder(boolean constraintMatchEnabled)
public BigDecimal getScore()
public void configureConstraintWeight(org.kie.api.definition.rule.Rule rule,
SimpleBigDecimalScore constraintWeight)
ScoreHolderConstraintWeight from the ConstraintConfiguration during initialization.configureConstraintWeight in interface ScoreHolder<SimpleBigDecimalScore>configureConstraintWeight in class AbstractScoreHolder<SimpleBigDecimalScore>rule - never nullconstraintWeight - never null, with Score.getInitScore() equal to 0.public void penalize(org.kie.api.runtime.rule.RuleContext kcontext)
ConstraintWeight negated.kcontext - never null, the magic variable in DRLpublic void penalize(org.kie.api.runtime.rule.RuleContext kcontext,
BigDecimal weightMultiplier)
ConstraintWeight negated and multiplied with the weightMultiplier for all score levels.kcontext - never null, the magic variable in DRLweightMultiplier - at least 0public void reward(org.kie.api.runtime.rule.RuleContext kcontext)
ConstraintWeight.kcontext - never null, the magic variable in DRLpublic void reward(org.kie.api.runtime.rule.RuleContext kcontext,
BigDecimal weightMultiplier)
ConstraintWeight multiplied with the weightMultiplier for all score levels.kcontext - never null, the magic variable in DRLweightMultiplier - at least 0public void addConstraintMatch(org.kie.api.runtime.rule.RuleContext kcontext,
BigDecimal weight)
kcontext - never null, the magic variable in DRLweight - never null, higher is better, negative for a penalty, positive for a rewardpublic SimpleBigDecimalScore extractScore(int initScore)
ScoreHolderScore, 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 PlanningSolutionCopyright © 2006–2018 JBoss by Red Hat. All rights reserved.