Um hospital deseja gerar a escala de plantão noturna de 5 farmacêuticos para o mês de Dezembro de 2015. Durante todo o mês será necessária a presença de pelo menos 2 farmacêuticos de plantão. Os farmacêuticos f1, f2, f3, f4 e f5 trabalham no regime 12X36, com cargas horárias quem demandam 12, 13, 10, 12 e 10 plantões respectivamte. Além disso, todos funcionários devem ter pelo menos 1 (uma) folga de 24h (ao todo ou em parte) no domingo a cada 4 semanas.
Seja X uma matriz 5x31, onde:
x[i,j] = 1 caso fj estaja escalado para o plantão do dia i
x[i,j] = 0 c.c.
var working {i in DAYS, j in WORKERS} integer >= 0, <= 1;
a) pelo menos 2 farmacêuticos de plantão
subject to Min_Service {i in DAYS}:
sum {j in WORKERS} working[i,j] >= 2;
b) cargas horárias quem demandam 12, 13, 10, 12 e 10 plantões
subject to Demand_13 {j in {2}}:
sum {i in DAYS} working[i,j] >= 13;
subject to Demand_12 {j in {1,4}}:
sum {i in DAYS} working[i,j] >= 12;
subject to Demand_10 {j in {3,5}}:
sum {i in DAYS} working[i,j] >= 10;
c) pelo menos 1 folga no domingo
subject to SundayRest {j in WORKERS}:
sum {i in SUNDAYS} working[i,j] <= 3;
d) regime 12X36
subject to Max_Consecutive {j in WORKERS, i in 2..31}:
(sum {a in {1}} working[i-1,j] + working[i,j]) <= 1;
Deseja-se minimizar a soma de todos os x[i,j].
minimize Total_Work: sum {i in DAYS, j in WORKERS} working[i,j];
option solver cplex;
solve;
display working;
display {i in DAYS} sum {j in WORKERS} working[i,j];
display {j in WORKERS} sum {i in DAYS} working[i,j];
display {j in WORKERS} sum {i in SUNDAYS} working[i,j];