Op 11-02-13 13:12, fdauffy schreef:
Hello,
I'm starting a project regarding shift planning and while trying Drools
Planner, I notice that in your documentation that somes contraints are given
as example like rest time between shift.
But in all the examples, I couldn't find any constraint like that.
Does anybody already work on such constraint?
Many thanks
Frédéric
Shouldn't be hard, something like this:
rule "todo"
when
$left : ShiftAssignment(
$employee : employee, employee != null,
$leftShiftEnd : shiftEnd
)
$right : ShiftAssignment(
employee == $employee,
shiftStart > $leftShiftEnd,
shiftStart < $leftShiftEnd + employee.minimumRestTime,
$rightShiftStart : shiftStart
)
not ShiftAssignment(
employee == $employee,
shiftStart > $leftShiftEnd,
shiftStart < $rightShiftStart
)
then
insertLogical(..., $leftShiftEnd + employee.minimumRestTime -
$rightShiftStart, $left, $right));
end
--
View this message in context:
http://drools.46999.n3.nabble.com/Drools-Planner-contraint-for-rest-time-...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users