I'm currently working to add a new feature in Optaplanner Nurse Rostering Example. First, I run the example and create a one month schedule for all employees. Then for one day (i.e. current day), I have a schedule like this :
Based on the picture, here is the situation:
Employee A calls in and said she can't come to work at that shift (the blue circle). Now, I need to reassign this shift only to employee G, since she is working on the same shift date and shift type, and a low priority shift (the red circle). The shift that was originally assigned to employee G will be dropped (unassigned).
So here is the constraint to reassign shift:
- We can only reassign shift to other employees which is assigned with the same shift date and shift type, and in our case, there are only employee G and J that available to be reassigned with the shift that left by employee A. We can't reassign shift to other employees instead of employee G and J.
- We should pick shift that have the lowest priority to be exchanged with the shift that was left by the sick employee, and dropped the lowest priority shift (unassigned it). If the shift that was left by sick employee was the lowest priority, then we should dropped it (unassigned it).
My questions are:
- How could we achieve this requirement? How we exchange lowest priority shift with the higher priority shift using drools rule?
- It is possible to left some shift unassigned? How we should do it? IIRC, optaplanner will try to assigned all shift, and left no shift unassigned.
Please help, any comment will be appreciated. Thanks.
Aucun commentaire:
Enregistrer un commentaire