This is my second post. I'm trying to study the nurse rostering examples. There is a way to avoid same shift in two consecutive day?
Optaplanner: how to avoid the same shift in two consecutive day?
149 views Asked by Gica At
1
This is my second post. I'm trying to study the nurse rostering examples. There is a way to avoid same shift in two consecutive day?
Avoiding same shift type in 2 consecutive days goes like this:your "when" clause should be true when there are 2 ShiftAssignments of the same nurse,same shift type with your second ShiftAssignment having ShiftDatedayindex = ShiftDateDayIndex of first Assignment +1; ShiftAssignment(...$ShiftType1:shiftType,day1:shiftDateDayIndex,...) ShiftAssignment(...$ShiftType2:shiftType,$ShiftType1==$ShiftType2,day2:shiftDateDayIndex,day2==day1+1...)