Class HardMediumSoftLongScoreHolderImpl

    • Constructor Detail

      • HardMediumSoftLongScoreHolderImpl

        public HardMediumSoftLongScoreHolderImpl​(boolean constraintMatchEnabled)
    • Method Detail

      • getHardScore

        public long getHardScore()
      • getMediumScore

        public long getMediumScore()
      • getSoftScore

        public long getSoftScore()
      • penalize

        public void penalize​(org.kie.api.runtime.rule.RuleContext kcontext,
                             long weightMultiplier)
        Description copied from interface: HardMediumSoftLongScoreHolder
        Penalize a match by the ConstraintWeight negated and multiplied with the weightMultiplier for all score levels.
        Specified by:
        penalize in interface HardMediumSoftLongScoreHolder
        Parameters:
        kcontext - never null, the magic variable in DRL
        weightMultiplier - at least 0
      • reward

        public void reward​(org.kie.api.runtime.rule.RuleContext kcontext,
                           long weightMultiplier)
        Description copied from interface: HardMediumSoftLongScoreHolder
        Reward a match by the ConstraintWeight multiplied with the weightMultiplier for all score levels.
        Specified by:
        reward in interface HardMediumSoftLongScoreHolder
        Parameters:
        kcontext - never null, the magic variable in DRL
        weightMultiplier - at least 0
      • impactScore

        public void impactScore​(org.kie.api.runtime.rule.RuleContext kcontext,
                                Object... justifications)
        Description copied from class: AbstractScoreHolder
        For internal use only, use penalize() or reward() instead.
        Overrides:
        impactScore in class AbstractScoreHolder<HardMediumSoftLongScore>
        Parameters:
        kcontext - never null
        justifications - the primary arguments(s) that the CS penalizes/rewards, not used outside of CS-D
      • impactScore

        public void impactScore​(org.kie.api.runtime.rule.RuleContext kcontext,
                                int weightMultiplier,
                                Object... justifications)
        Description copied from class: AbstractScoreHolder
        For internal use only, use penalize() or reward() instead.
        Specified by:
        impactScore in class AbstractScoreHolder<HardMediumSoftLongScore>
        Parameters:
        kcontext - never null
        weightMultiplier - any
        justifications - the primary arguments(s) that the CS penalizes/rewards, not used outside of CS-D
      • impactScore

        public void impactScore​(org.kie.api.runtime.rule.RuleContext kcontext,
                                long weightMultiplier,
                                Object... justifications)
        Description copied from class: AbstractScoreHolder
        For internal use only, use penalize() or reward() instead.
        Specified by:
        impactScore in class AbstractScoreHolder<HardMediumSoftLongScore>
        Parameters:
        kcontext - never null
        weightMultiplier - any
        justifications - the primary arguments(s) that the CS penalizes/rewards, not used outside of CS-D
      • impactScore

        public void impactScore​(org.kie.api.runtime.rule.RuleContext kcontext,
                                BigDecimal weightMultiplier,
                                Object... justifications)
        Description copied from class: AbstractScoreHolder
        For internal use only, use penalize() or reward() instead.
        Specified by:
        impactScore in class AbstractScoreHolder<HardMediumSoftLongScore>
        Parameters:
        kcontext - never null
        weightMultiplier - any
        justifications - the primary arguments(s) that the CS penalizes/rewards, not used outside of CS-D
      • addHardConstraintMatch

        public void addHardConstraintMatch​(org.kie.api.runtime.rule.RuleContext kcontext,
                                           long hardWeight)
        Specified by:
        addHardConstraintMatch in interface HardMediumSoftLongScoreHolder
        Parameters:
        kcontext - never null, the magic variable in DRL
        hardWeight - higher is better, negative for a penalty, positive for a reward
      • addMediumConstraintMatch

        public void addMediumConstraintMatch​(org.kie.api.runtime.rule.RuleContext kcontext,
                                             long mediumWeight)
        Specified by:
        addMediumConstraintMatch in interface HardMediumSoftLongScoreHolder
        Parameters:
        kcontext - never null, the magic variable in DRL
        mediumWeight - higher is better, negative for a penalty, positive for a reward
      • addSoftConstraintMatch

        public void addSoftConstraintMatch​(org.kie.api.runtime.rule.RuleContext kcontext,
                                           long softWeight)
        Specified by:
        addSoftConstraintMatch in interface HardMediumSoftLongScoreHolder
        Parameters:
        kcontext - never null, the magic variable in DRL
        softWeight - higher is better, negative for a penalty, positive for a reward
      • addMultiConstraintMatch

        public void addMultiConstraintMatch​(org.kie.api.runtime.rule.RuleContext kcontext,
                                            long hardWeight,
                                            long mediumWeight,
                                            long softWeight)
        Specified by:
        addMultiConstraintMatch in interface HardMediumSoftLongScoreHolder
        Parameters:
        kcontext - never null, the magic variable in DRL
        hardWeight - higher is better, negative for a penalty, positive for a reward
        mediumWeight - higher is better, negative for a penalty, positive for a reward
        softWeight - higher is better, negative for a penalty, positive for a reward