[jboss-svn-commits] JBL Code SVN: r18271 - labs/jbossrules/trunk/drools-solver/drools-solver-examples/src/main/resources/org/drools/solver/examples/itc2007/examination/solver.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sat Feb 2 18:18:52 EST 2008


Author: ge0ffrey
Date: 2008-02-02 18:18:52 -0500 (Sat, 02 Feb 2008)
New Revision: 18271

Modified:
   labs/jbossrules/trunk/drools-solver/drools-solver-examples/src/main/resources/org/drools/solver/examples/itc2007/examination/solver/examinationScoreRules.drl
Log:
fix score calculation corruption

Modified: labs/jbossrules/trunk/drools-solver/drools-solver-examples/src/main/resources/org/drools/solver/examples/itc2007/examination/solver/examinationScoreRules.drl
===================================================================
--- labs/jbossrules/trunk/drools-solver/drools-solver-examples/src/main/resources/org/drools/solver/examples/itc2007/examination/solver/examinationScoreRules.drl	2008-02-02 17:04:48 UTC (rev 18270)
+++ labs/jbossrules/trunk/drools-solver/drools-solver-examples/src/main/resources/org/drools/solver/examples/itc2007/examination/solver/examinationScoreRules.drl	2008-02-02 23:18:52 UTC (rev 18271)
@@ -79,13 +79,13 @@
             $leftSideTopic : leftSideTopic,
             $rightSideTopic : rightSideTopic
         );
-        Exam(topic == $leftSideTopic, $leftSidePeriod : period);
-        Exam(topic == $rightSideTopic, period != $leftSidePeriod);
+        $leftExam : Exam(topic == $leftSideTopic, $leftSidePeriod : period);
+        $rightExam : Exam(topic == $rightSideTopic, period != $leftSidePeriod);
         // LeftSide and rightSide don't share a student because those are filtered out in the InputConvertor
     then
         insertLogical(new IntConstraintOccurrence("periodHardConstraintExamCoincidence", ConstraintType.NEGATIVE_HARD,
                 ($leftSideTopic.getStudentSize() + $rightSideTopic.getStudentSize()),
-                $periodHardConstraint));
+                $leftExam, $rightExam));
 end
 rule "periodHardConstraintExclusion"
     when
@@ -94,12 +94,12 @@
             $leftSideTopic : leftSideTopic,
             $rightSideTopic : rightSideTopic
         );
-        Exam(topic == $leftSideTopic, $leftSidePeriod : period);
-        Exam(topic == $rightSideTopic, period == $leftSidePeriod);
+        $leftExam : Exam(topic == $leftSideTopic, $leftSidePeriod : period);
+        $rightExam : Exam(topic == $rightSideTopic, period == $leftSidePeriod);
     then
         insertLogical(new IntConstraintOccurrence("periodHardConstraintExclusion", ConstraintType.NEGATIVE_HARD,
                 ($leftSideTopic.getStudentSize() + $rightSideTopic.getStudentSize()),
-                $periodHardConstraint));
+                $leftExam, $rightExam));
 end
 rule "periodHardConstraintAfter"
     when
@@ -108,14 +108,14 @@
             $leftSideTopic : leftSideTopic,
             $rightSideTopic : rightSideTopic
         );
-        Exam(topic == $leftSideTopic, $afterSidePeriod : period);
-        Exam(topic == $rightSideTopic, eval($afterSidePeriod.getPeriodIndex() <= period.getPeriodIndex()),
+        $leftExam : Exam(topic == $leftSideTopic, $afterSidePeriod : period);
+        $rightExam : Exam(topic == $rightSideTopic, eval($afterSidePeriod.getPeriodIndex() <= period.getPeriodIndex()),
             $beforeSidePeriod : period
         );
     then
         insertLogical(new IntConstraintOccurrence("periodHardConstraintAfter", ConstraintType.NEGATIVE_HARD,
                 ($leftSideTopic.getStudentSize() + $rightSideTopic.getStudentSize()),
-                $periodHardConstraint));
+                $leftExam, $rightExam));
 end
 
 // Room hard constraints
@@ -125,12 +125,12 @@
             roomHardConstraintType == RoomHardConstraintType.ROOM_EXCLUSIVE,
             $topic : topic
         );
-        Exam(topic == $topic, $room : room);
-        Exam(room == $room, topic != $topic, $otherTopic : topic);
+        $leftExam : Exam(topic == $topic, $room : room);
+        $rightExam : Exam(room == $room, topic != $topic, $otherTopic : topic);
     then
         insertLogical(new IntConstraintOccurrence("roomHardConstraintExclusive", ConstraintType.NEGATIVE_HARD,
                 ($topic.getStudentSize() + $otherTopic.getStudentSize()),
-                $roomHardConstraint));
+                $leftExam, $rightExam));
 end
 
 // Accumulate hard constraints




More information about the jboss-svn-commits mailing list