[jboss-svn-commits] JBL Code SVN: r33047 - labs/jbossrules/trunk/drools-planner/drools-planner-examples/src/main/resources/org/drools/planner/examples/nurserostering/solver.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon May 24 11:28:01 EDT 2010


Author: ge0ffrey
Date: 2010-05-24 11:28:01 -0400 (Mon, 24 May 2010)
New Revision: 33047

Modified:
   labs/jbossrules/trunk/drools-planner/drools-planner-examples/src/main/resources/org/drools/planner/examples/nurserostering/solver/nurseRosteringScoreRules.drl
Log:
fix weighting

Modified: labs/jbossrules/trunk/drools-planner/drools-planner-examples/src/main/resources/org/drools/planner/examples/nurserostering/solver/nurseRosteringScoreRules.drl
===================================================================
--- labs/jbossrules/trunk/drools-planner/drools-planner-examples/src/main/resources/org/drools/planner/examples/nurserostering/solver/nurseRosteringScoreRules.drl	2010-05-24 15:00:31 UTC (rev 33046)
+++ labs/jbossrules/trunk/drools-planner/drools-planner-examples/src/main/resources/org/drools/planner/examples/nurserostering/solver/nurseRosteringScoreRules.drl	2010-05-24 15:28:01 UTC (rev 33047)
@@ -87,7 +87,7 @@
 // Minimum number of assignments
 rule "minimumTotalAssignments"
     when
-        MinMaxContractLine(
+        $contractLine : MinMaxContractLine(
             contractLineType == ContractLineType.TOTAL_ASSIGNMENTS, minimumEnabled == true,
             $contract : contract, $minimumValue : minimumValue
         )
@@ -95,14 +95,14 @@
             $employee : employee, $total : total)
     then
         insertLogical(new IntConstraintOccurrence("minimumTotalAssignments", ConstraintType.NEGATIVE_SOFT,
-                $minimumValue - $total,
+                ($minimumValue - $total) * $contractLine.getMinimumWeight(),
                 $employee));
 end
 
 // Maximum number of assignments
 rule "maximumTotalAssignments"
     when
-        MinMaxContractLine(
+        $contractLine : MinMaxContractLine(
             contractLineType == ContractLineType.TOTAL_ASSIGNMENTS, maximumEnabled == true,
             $contract : contract, $maximumValue : maximumValue
         )
@@ -110,7 +110,7 @@
             $employee : employee, $total : total)
     then
         insertLogical(new IntConstraintOccurrence("maximumTotalAssignments", ConstraintType.NEGATIVE_SOFT,
-                $total - $maximumValue,
+                ($total - $maximumValue) * $contractLine.getMaximumWeight(),
                 $employee));
 end
 
@@ -378,13 +378,14 @@
 // Alternative skill
 rule "alternativeSkill"
     when
-        BooleanContractLine(contractLineType == ContractLineType.ALTERNATIVE_SKILL_CATEGORY, $contract : contract)
+        $contractLine : BooleanContractLine(contractLineType == ContractLineType.ALTERNATIVE_SKILL_CATEGORY,
+            $contract : contract)
         $employeeAssignment : Assignment(contract == $contract, $employee : employee, $shiftType : shiftType)
         ShiftTypeSkillRequirement(shiftType == $shiftType, $skill : skill)
         not SkillProficiency(employee == $employee, skill == $skill)
     then
         insertLogical(new IntConstraintOccurrence("alternativeSkill", ConstraintType.NEGATIVE_SOFT,
-                1,
+                $contractLine.getWeight(),
                 $employeeAssignment));
 end
 



More information about the jboss-svn-commits mailing list