Skip to content

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

Description

@Mihailby

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions