Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue on page /notebooks/03/shift-scheduling.html #1

Open
Mihailby opened this issue Mar 4, 2024 · 0 comments
Open

Issue on page /notebooks/03/shift-scheduling.html #1

Mihailby opened this issue Mar 4, 2024 · 0 comments

Comments

@Mihailby
Copy link

Mihailby commented Mar 4, 2024

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:

  1. 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant