You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys!
Thank you very much for the wonderful guide "MO-BOOK: Hands-On Mathematical Optimization with AMPL in Python".
In the AMPL model, it is not entirely clear how the BLOCKS set is formed; I believe that it can be formed using the following expression:
If we declare set SHIFTS as circular:
set SHIFTS circular = {'Morning','Evening', 'Night'};
set BLOCKS = {d in DAYS, s in SHIFTS, d1 in DAYS, s1 in SHIFTS, d2 in DAYS, s2 in SHIFTS:
if s = first(SHIFTS) then d1 = d and d2 = d and s1= next(s) and s2 = next(s, SHIFTS,2) or
if s = last(SHIFTS) and d!=last(DAYS) then d1 = next(d) and d2 = next(d) and s1= next(s) and s2 = next(s, SHIFTS,2) or
if s = "Evening" and d!=last(DAYS) then d1 = d and d2 = next(d) and s1= next(s) and s2 = next(s, SHIFTS,2)};
Thank you so much again!
The text was updated successfully, but these errors were encountered:
Hi guys!
Thank you very much for the wonderful guide "MO-BOOK: Hands-On Mathematical Optimization with AMPL in Python".
In the AMPL model, it is not entirely clear how the BLOCKS set is formed; I believe that it can be formed using the following expression:
set SHIFTS circular = {'Morning','Evening', 'Night'};
set BLOCKS = {d in DAYS, s in SHIFTS, d1 in DAYS, s1 in SHIFTS, d2 in DAYS, s2 in SHIFTS:
if s = first(SHIFTS) then d1 = d and d2 = d and s1= next(s) and s2 = next(s, SHIFTS,2) or
if s = last(SHIFTS) and d!=last(DAYS) then d1 = next(d) and d2 = next(d) and s1= next(s) and s2 = next(s, SHIFTS,2) or
if s = "Evening" and d!=last(DAYS) then d1 = d and d2 = next(d) and s1= next(s) and s2 = next(s, SHIFTS,2)};
Thank you so much again!
The text was updated successfully, but these errors were encountered: