[jboss-svn-commits] JBL Code SVN: r36094 - in labs/jbossrules/trunk/drools-planner/drools-planner-examples/src/main: resources/org/drools/planner/examples/curriculumcourse/solver and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Nov 28 10:43:43 EST 2010


Author: ge0ffrey
Date: 2010-11-28 10:43:42 -0500 (Sun, 28 Nov 2010)
New Revision: 36094

Modified:
   labs/jbossrules/trunk/drools-planner/drools-planner-examples/src/main/java/org/drools/planner/examples/app/ExamplesApp.java
   labs/jbossrules/trunk/drools-planner/drools-planner-examples/src/main/resources/org/drools/planner/examples/curriculumcourse/solver/curriculumCourseScoreRules.drl
Log:
remove unnecessary ; from drl files

Modified: labs/jbossrules/trunk/drools-planner/drools-planner-examples/src/main/java/org/drools/planner/examples/app/ExamplesApp.java
===================================================================
--- labs/jbossrules/trunk/drools-planner/drools-planner-examples/src/main/java/org/drools/planner/examples/app/ExamplesApp.java	2010-11-28 15:34:56 UTC (rev 36093)
+++ labs/jbossrules/trunk/drools-planner/drools-planner-examples/src/main/java/org/drools/planner/examples/app/ExamplesApp.java	2010-11-28 15:43:42 UTC (rev 36094)
@@ -74,12 +74,12 @@
                 new SmartTravelingTournamentApp().init(false);
             }
         }));
-        contentPane.add(new JButton(new AbstractAction("Curriculum course timetabling (ITC2007 track1)"){
+        contentPane.add(new JButton(new AbstractAction("Curriculum course timetabling (ITC2007 track3)"){
             public void actionPerformed(ActionEvent e) {
                 new CurriculumCourseApp().init(false);
             }
         }));
-        contentPane.add(new JButton(new AbstractAction("Examination timetabling (ITC2007 track3)"){
+        contentPane.add(new JButton(new AbstractAction("Examination timetabling (ITC2007 track1)"){
             public void actionPerformed(ActionEvent e) {
                 new ExaminationApp().init(false);
             }

Modified: labs/jbossrules/trunk/drools-planner/drools-planner-examples/src/main/resources/org/drools/planner/examples/curriculumcourse/solver/curriculumCourseScoreRules.drl
===================================================================
--- labs/jbossrules/trunk/drools-planner/drools-planner-examples/src/main/resources/org/drools/planner/examples/curriculumcourse/solver/curriculumCourseScoreRules.drl	2010-11-28 15:34:56 UTC (rev 36093)
+++ labs/jbossrules/trunk/drools-planner/drools-planner-examples/src/main/resources/org/drools/planner/examples/curriculumcourse/solver/curriculumCourseScoreRules.drl	2010-11-28 15:43:42 UTC (rev 36094)
@@ -47,14 +47,14 @@
 // Three conflicting lectures count as 3 violations: one for each pair.
 rule "conflictingLecturesInSamePeriod"
     when
-        $leftCourse : Course($leftCourseId : id, $leftTeacher : teacher, $leftCurriculumList : curriculumList);
+        $leftCourse : Course($leftCourseId : id, $leftTeacher : teacher, $leftCurriculumList : curriculumList)
         // Lectures of the same course can also be conflicting
-        $rightCourse : Course(id >= $leftCourseId, $rightTeacher : teacher, $rightCurriculumList : curriculumList);
+        $rightCourse : Course(id >= $leftCourseId, $rightTeacher : teacher, $rightCurriculumList : curriculumList)
         eval($leftTeacher == $rightTeacher)
-            or exists Curriculum(this memberOf $leftCurriculumList, this memberOf $rightCurriculumList);
+            or exists Curriculum(this memberOf $leftCurriculumList, this memberOf $rightCurriculumList)
 
-        $leftLecture : Lecture(course == $leftCourse, $period : period);
-        $rightLecture : Lecture(course == $rightCourse, period == $period, this != $leftLecture);
+        $leftLecture : Lecture(course == $leftCourse, $period : period)
+        $rightLecture : Lecture(course == $rightCourse, period == $period, this != $leftLecture)
     then
         insertLogical(new IntConstraintOccurrence("conflictingLecturesInSamePeriod",
                 ConstraintType.NEGATIVE_HARD, 1,
@@ -65,11 +65,11 @@
 // Any extra lecture in the same period and room counts as one more violation.
 rule "roomOccupancy"
     when
-        $leftLecture : Lecture($leftId : id, $period : period, room != null, $room : room);
+        $leftLecture : Lecture($leftId : id, $period : period, room != null, $room : room)
         // $leftLecture has lowest id of the period+room combo
-        not Lecture(period == $period, room == $room, id < $leftId);
+        not Lecture(period == $period, room == $room, id < $leftId)
         // rightLecture has the same period
-        $rightLecture : Lecture(period == $period, room == $room, id > $leftId, $rightId : id);
+        $rightLecture : Lecture(period == $period, room == $room, id > $leftId, $rightId : id)
     then
         insertLogical(new IntConstraintOccurrence("roomOccupancy", ConstraintType.NEGATIVE_HARD,
                 1,
@@ -79,8 +79,8 @@
 // Availabilities: Each lecture in a period unavailable for that course.
 rule "unavailablePeriodConstraint"
     when
-        $unavailablePeriodConstraint : UnavailablePeriodConstraint($course : course, $period : period);
-        $lecture : Lecture(course == $course, period == $period);
+        $unavailablePeriodConstraint : UnavailablePeriodConstraint($course : course, $period : period)
+        $lecture : Lecture(course == $course, period == $period)
     then
         insertLogical(new IntConstraintOccurrence("unavailablePeriodConstraint", ConstraintType.NEGATIVE_HARD,
                 1,
@@ -97,7 +97,7 @@
 // Each student above the capacity counts as 1 point of penalty.
 rule "roomCapacity"
     when
-        $room : Room($capacity : capacity);
+        $room : Room($capacity : capacity)
         $lecture : Lecture(room == $room, studentSize > $capacity, $studentSize : studentSize)
     then
         insertLogical(new IntConstraintOccurrence("roomCapacity", ConstraintType.NEGATIVE_SOFT,
@@ -109,12 +109,12 @@
 // Each day below the minimum counts as 5 points of penalty.
 rule "minimumWorkingDays"
     when
-        $course : Course($minWorkingDaySize : minWorkingDaySize);
+        $course : Course($minWorkingDaySize : minWorkingDaySize)
         $dayCount : Number(intValue < $minWorkingDaySize) from accumulate(
             $day : Day()
             and exists Lecture(course == $course, day == $day),
             count($day)
-        );
+        )
         // HACK to fix wierd truth maintance behavior in drools
         // because making weight part of the equals/hashcode doesn't cut it
         not IntConstraintOccurrence(
@@ -122,9 +122,9 @@
             constraintType == ConstraintType.NEGATIVE_SOFT,
             causes contains $course,
             eval(weight != (($minWorkingDaySize - $dayCount.intValue()) * 5))
-        );
+        )
         // An uninitialized schedule should have no constraints broken
-        exists Lecture(course == $course);
+        exists Lecture(course == $course)
     then
         insertLogical(new IntConstraintOccurrence("minimumWorkingDays", ConstraintType.NEGATIVE_SOFT,
                 (($minWorkingDaySize - $dayCount.intValue()) * 5),
@@ -138,17 +138,17 @@
 // Each isolated lecture in a curriculum counts as 2 points of penalty.
 rule "curriculumCompactness"
     when
-        $curriculum : Curriculum();
+        $curriculum : Curriculum()
 
         $lecture : Lecture(curriculumList contains $curriculum,
             $day : day, $timeslotIndex : timeslotIndex
-        );
+        )
         not Lecture(curriculumList contains $curriculum,
             day == $day, timeslotIndex == ($timeslotIndex - 1)
-        );
+        )
         not Lecture(curriculumList contains $curriculum,
             day == $day, timeslotIndex == ($timeslotIndex + 1)
-        );
+        )
     then
         insertLogical(new IntConstraintOccurrence("curriculumCompactness", ConstraintType.NEGATIVE_SOFT,
                 2,
@@ -159,12 +159,12 @@
 // Each distinct room used for the lectures of a course, but the first, counts as 1 point of penalty.
 rule "roomStability"
     when
-        $course : Course();
+        $course : Course()
         $roomCount : Number(intValue > 1) from accumulate(
             $room : Room()
             and exists Lecture(course == $course, room == $room),
             count($room)
-        );
+        )
     then
         insertLogical(new IntConstraintOccurrence("roomStability", ConstraintType.NEGATIVE_SOFT,
                 ($roomCount.intValue() - 1),
@@ -182,7 +182,7 @@
         $hardTotal : Number() from accumulate(
             IntConstraintOccurrence(constraintType == ConstraintType.NEGATIVE_HARD, $weight : weight),
             sum($weight) // Vote for http://jira.jboss.com/jira/browse/JBRULES-1075
-        );
+        )
     then
         scoreCalculator.setHardConstraintsBroken($hardTotal.intValue());
 end
@@ -194,7 +194,7 @@
         $softTotal : Number() from accumulate(
             IntConstraintOccurrence(constraintType == ConstraintType.NEGATIVE_SOFT, $weight : weight),
             sum($weight) // Vote for http://jira.jboss.com/jira/browse/JBRULES-1075
-        );
+        )
     then
         scoreCalculator.setSoftConstraintsBroken($softTotal.intValue());
 end



More information about the jboss-svn-commits mailing list