[rules-users] Planner 5.3.Final - "presumedScore is corrupted" when using "update" on the rules working memory

guyramirez guyramirez at hotmail.com
Fri Dec 2 00:02:39 EST 2011


> Verify that IntervalRequirement doesn't change during planning. 
It does not change as IntervalRequirement is immutable.

> Are you using drools-planner-core 5.3.0.Final with drools-core 5.3.0.Final
> and drools-compiler 5.3.0.Final? 
Yes using 5.3.0.Final from the Planner 5.3 download location.

After your suggestions, here my complete drl (you will probably recognize
some of your own code :)):

rule "intervalRequirementCovered"
	when
		$intervalReq : IntervalRequirement($interval : interval, $position :
position, $staffingRequired : staffingRequired)
		$matchingShiftAssignmentsCount : Number(intValue() < $staffingRequired)
from accumulate(
            $matchingShiftAssignments : ShiftAssignment(shiftStartTime <=
$interval
            								, shiftEndTime > $interval, position == $position)
            								, count($matchingShiftAssignments)
        )
	then 
		#actions
		insertLogical(new IntConstraintOccurrence("intervalRequirementCovered",
ConstraintType.NEGATIVE_HARD,
					$matchingShiftAssignmentsCount.intValue() - $staffingRequired,
$intervalReq));
end


rule "hardConstraintsBroken"
        salience -1 // Do the other rules first (optional, for performance)
    when
        $hardTotal : Number() from accumulate(
            IntConstraintOccurrence(constraintType ==
ConstraintType.NEGATIVE_HARD, $weight : weight), sum($weight)
        )
    then
        scoreCalculator.setHardConstraintsBroken($hardTotal.intValue());
end


Unfortunately still having the same issue, that is, updates on my planning
entity are not reflected in the engine. Drools Experts mentions the
following when updating facts:
"The update() method can only be used with objects that have shadow proxies
turned on".
Not sure how to check about those shadow proxies, but is it something worth
looking into?

Thanks,
Guy

--
View this message in context: http://drools.46999.n3.nabble.com/Planner-5-3-Final-presumedScore-is-corrupted-when-using-update-on-the-rules-working-memory-tp3546932p3553818.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list