Hi IBM,
It has been a while. I am back ^^
My end-goal is to model a Contact Center Scheduling Problem in CP. In order to get there, I started with Nurse Scheduling Problem.
I was able to reproduce an MIP model for the same problem in the attached paper. The problem is more like an allocation problem. But, I decided to try a CP model and I became lost even after several years of CP experiences. The most tricky one to model the problem in CP are following constraints: maximum consecutive shifts, minimum consecutive shifts, minimum consecutive days off. Here are my questions:
(1) can you please give me a sketch how would you model the Nurse Scheduling Problem in CP?
(2) I am trying to pre-calculate all feasible work plans (it will be very large count; I will limit first 1000, for instance) for each agent and use alternative method to assign one of feasible plans to agent so that the three constraints could be already met. For this, I need your help. How to create a tuple AGENT2 out of AGENT with condition? In the following example, I am trying to keep only agent "A" in AGENT2. How can I do that? I have tried the codes in below, but it did not work.
AGENT={
< A,[28,28],8640,7560,5,2,2,2 >
< B,[28,0],8640,7560,5,2,2,2 >
< C,[28,28],8640,7560,5,2,2,2 >
};
using CP;
tuple t_AGENT {
key string a; //agent
int ms[1..2]; //shift length in minutes
int maxMin; //MaxTotalMinutes
int minMin; //MinTotalMinutes
int maxConS; //MaxConsecutiveShifts
int minConS; //MinConsecutiveShifts
int minConDOff; //MinConsecutiveDaysOff
int maxWeekends; // MaxWeekends
}
{t_AGENT} AGENT = ...;
//{t_AGENT} AGENT2 = {a in AGENT: a.a=="A"};
//{t_AGENT} AGENT2 = {<a.a,a.ms,a.maxMin,a.minMin,a.maxConS,a.minConS,a.minConDOff,a.maxWeekends> | a in AGENT: a.a=="A"};
execute { writeln(AGENT);}
Thanks,
Andy
#DecisionOptimization