Tasks Assignment For Nurse Roster Planning Problem

153 views
Skip to first unread message

Wizard

unread,
Apr 23, 2017, 1:05:41 PM4/23/17
to OptaPlanner development
Hi everyone, 
I have a requirement to add tasks assignment to nurse roster planning problem. Currently the assignment was just for employee, and I need to add the second planning variable, that is task. There are one or two tasks for each shift, if the task is a FULL type, then it should only be one in ShiftAssignment, but if the task is SHORT or MAIN, then it could be assign together in shift assigment. Should I add two or three new planning variables? 
The other question is if I set nullable for each new planning variables, will it make the search space bigger?
Any comment and opinion will be appreciated.
Best regards.

Wizard

unread,
Apr 26, 2017, 7:05:53 AM4/26/17
to OptaPlanner development
Hello,
Is there anyone who could help me with some advice or opinion? I also post it to stackoverflow (http://stackoverflow.com/questions/43402505/add-three-new-planning-variables-to-nurse-roster-solution).. Please kindly help me. Thanks and regards.

Chris T

unread,
Apr 26, 2017, 5:37:55 PM4/26/17
to OptaPlanner development
You can simply combine the planning variables and add an attribute that indicates if the task is full or short.  A rule would then constrain to make certain that too many tasks are not assigned.   Perhaps your problem may allow multiple short tasks to be assigned - and the rule could account for that as well.
Multiple variables complicates things.  I'd avoid it unless you have other attributes that require that they be separate.

Osamu Kuniyasu

unread,
May 2, 2017, 6:10:55 PM5/2/17
to OptaPlanner development
Hi Wizard,

Task is the planning entity which has an employee planning variable for the task assignment problem.
and add rules as Chiris T mentioned.

I'm not sure if
 - Task may have due date and can be done early date(soft) or late date (hard)
 - Skill constraints
 - Task duration consideration how can multiple tasks are mixed
 - fairness
 - Tasks can over-wrap

Wizard, I would recommend to check the some patterns Geoffrey-san mentioned if you have not read it.
https://www.optaplanner.org/blog/2015/12/01/TimeSchedulingDesignPatterns.html

hope it helps,

Osamu Kuniyasu


2017年4月27日木曜日 6時37分55秒 UTC+9 Chris T:

Wizard

unread,
May 7, 2017, 5:35:51 AM5/7/17
to OptaPlanner development
Hi Chris, 
Thanks for sharing your thoughts. Yes, I know multiple variables is a complicated things, but it was one of the client requirements, so it is a must. My current work was based on Nurse Roster Planning Problem Example from Optaplanner, and I got some confuse in writing the move class, especially for the swap move, it consist of 4 class : 
  1. ShiftAssignmentPillarPartSwapMoveFactory
  2. ShiftAssignmentSequenceSwitchLength2MoveFactory
  3. ShiftAssignmentSequenceSwitchLength3MoveFactory
  4. ShiftAssignmentSwapMoveFactory
When I look into ShiftAssignmentSwapMoveFactory class, it only swap 2 ShiftAssignment objects, but I not really sure what the three others classes were use for, do you have any idea? 
Thanks and regards.

Wizard

unread,
May 7, 2017, 5:40:04 AM5/7/17
to OptaPlanner development
Hi Osamu,
My current work was based on Nurse Rostering Example from Optaplanner, not the Task Assignment Example. What I trying to achieve is, add 2 planning variables, shortTask and mainTask, which will be changed during solving phase by Optaplanner solver. But to make it working correctly, I encounter some problem, especially writing the correct Move class. Please read my previous answer for Chris, about what I confused for, as the documentation on this Move class was actually poor in my oponion, I think it should be more explanation about this chapter, and more examples too.
Thanks and regards.
Reply all
Reply to author
Forward
0 new messages