[rules-users] Planner/solver - POSITIVE scoring...

Michael Neale michael.neale at gmail.com
Thu Jan 7 01:23:03 EST 2010


Hi All - FYI I have been conversing with Geoffrey on basic
solver/planner usage questions, but we are bring the discussion here
in case others can benefit.

So I am looking at using IntConstraintOccurrence, for scoring with
weights, and HardAndSoftConstraintScoreCalculator. So I can see how
NEGATIVE_HARD and NEGATIVE_SOFT scores would work, with appropriate
accumulator rules doing that etc.

What I am not sure about is ConstraintType.POSITIVE - so I want to use
that to "favour" certain aspects of a solution. So would the correct
way to use that to be to have rules that use a positive
IntConstrainOccurrence, and then do something like:

    when
        $softTotal : Number() from accumulate(
            IntConstraintOccurrence(constraintType ==
ConstraintType.NEGATIVE_SOFT, $weight : weight),
            sum($weight) // Vote for
http://jira.jboss.com/jira/browse/JBRULES-1075
        );
       $positiveTotal: Number() from accumulate(
            IntConstraintOccurrence(constraintType ==
ConstraintType.POSITIVE, $weight : weight),
            sum($weight) // Vote for
http://jira.jboss.com/jira/browse/JBRULES-1075
        );

    then
        scoreCalculator.setSoftConstraintsBroken($softTotal.intValue()
- $positiveTotal.intValue());



?? it seems odd - I want to use POSITIVE but I am using it to reduce
the soft constraints broken? The the higher the positive score, the
less softConstraintsBroken property of the score calculator is set -
that seems odd... or should I not use HardAndSoft if I am using
POSITIVE and NEGATIVE scoring?


-- 
Michael D Neale
home: www.michaelneale.net
blog: michaelneale.blogspot.com



More information about the rules-users mailing list