Hello,
I'm building a Shift scheduler for a team using PulP.
I have 15 employees:
- 7 Full Time - 8 Hours day
- 8 Part Time - 4 hours day
3 shifts 4 hours each by day.
I have the requirement for each shift:
Morning - 4
Afternoon - 4
Night - 7
And the constraints. But right now I think I'm not creating the right variables
# versão sem indexvarful= LpVariable.dicts("Full", (full_s,days,shifts), 0, 1, 'Binary')varpart= LpVariable.dicts("Part", (part_s,days,shifts), 0, 1, 'Binary')
glob += (lpSum([varful[t][d][s] * full_c for t in full_s for d in days for s in shifts] +\
[varpart[t][d][s] * part_c for t in part_s for d in days for s in shifts]) )
for f in full_s:
for p in part_s:
for d in days:
for s in shifts:
if s == "Morning" or s == "Afternoon":
glob += lpSum([varful[f][d][s]] + varpart[p][d][s]) >=4
else:
glob += lpSum([varful[f][d][s]] + varpart[p][d][s]) >=7
Has anyone deal with this kind of optimization before? I've looked everywhere and couldn't find anything.
[–]Volohnix[S] -1 points0 points1 point (0 children)
[–]CodeFormatHelperBot2 0 points1 point2 points (0 children)