That could be a bug.

Alternatively, you could just get rid of the exist, bind to the lesson - so the logical assertion happens for each lesson. As long as equals and hashcode are correct on your HardConstraint, it doesn't matter how many times it is asserted, it just builds up evidence. So all the lessons have to disappear before the auto retraction happens.

Michael.

On 11/2/06, Geoffrey De Smet <[EMAIL PROTECTED]> wrote:
I have a rule like this:

rule teacherCanOnlyTeachOneGroupAtATime
   when
     $lesson : Lesson($id : id, $teacher : teacher, $timeslot : timeslot);
     exists Lesson(id > $id, teacher == $teacher, timeslot == $timeslot);
   then
     assertLogical(new HardConstraint(new Object[]{$lesson}, 1));
     // new HardConstraint(causesToUseInEqualsMethod, weight)
end


This leads to a false HardConstraint (after a while of using the same
workingMemory).
I suspect this is because the HardConstraint's equals() method only
verifies versus the $lesson, while it should also verify versus the list
of existing lessons?
But it can't do "$lessonList : exists Lesson(...)".

--
With kind regards,
Geoffrey De Smet


---------------------------------------------------------------------
To unsubscribe from this list please visit:

     http://xircles.codehaus.org/manage_email


Reply via email to