我在理解在OptaPlanner演示示例(NurseRostering應用程序)之一中實現的Drools規則時遇到問題。誰能解釋下面的規則是如何工作的:NurseRostering應用程序中Drools規則的說明
// a nurse can only work one shift per day, i.e. no two shift can be assigned to the same nurse on a day.
rule "oneShiftPerDay"
when
$leftAssignment : ShiftAssignment($leftId : id, $employee : employee, $shiftDate : shiftDate)
$rightAssignment : ShiftAssignment(employee == $employee, shiftDate == $shiftDate, id > $leftId)
then
insertLogical(new IntConstraintOccurrence("oneShiftPerDay", ConstraintType.NEGATIVE_HARD,
1,
$leftAssignment, $rightAssignment));
end
是否有大約規則的解釋和方式詳細其中規定任何資源得到實施?當我在網上和某些書中查看一些示例時,我發現它很容易理解,但是當我檢查Drools中提供的示例時,我無法得到一個想法。