Please help me write constraint in Cplex. I'm solving a staff scheduling problem.
I have following sets:
{string} I=...; // set of all physicians
{string} E=...; // set of experience levels
{string} K=...; //type of shifts
{string} A=...;//work type
int D=...;
range Day=1..D; //scheduling horizon is from day 1 to day 30
Data:
I={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T"};
E={"Senior","Rookie"};
K={"o","t"};
A={"Day","Evening","Night","Night1","Night2"};
Decision Variable:
dvar int x[I][E][Day][K][A] in 0..1; //1, if physician i with experience level e is assigned to day d with shift type k with work type a
Constraint: evening+night constraint
My main problem is, since I only need to focus on "Evening" and "Day" in set A, I don't know how to express it in Cplex.
forall(i in I, e in E, d in D, k in K, Evening in A, Day in A)
{
x [i, e, (d-1), k, Evening]+ x[i, e, d, k, Day]<=1;
}
Above is my trying but fail.
Thank you for the help!