Commit fb0db627 authored by Jack Otto's avatar Jack Otto
Browse files

11/18/21 wendy chnage

parent ba0fae6d
...@@ -203,17 +203,17 @@ def full_schedule(): ...@@ -203,17 +203,17 @@ def full_schedule():
model.Add(scheduled_classes[n, c, p, "Th", "13"] == 0) model.Add(scheduled_classes[n, c, p, "Th", "13"] == 0)
model.Add(scheduled_classes[n, c, p, "Th", "14"] == 0) model.Add(scheduled_classes[n, c, p, "Th", "14"] == 0)
print("Adding constraint to not schedule classes of same color at the same times") # print("Adding constraint to not schedule classes of same color at the same times")
for n in courses: # for n in courses:
for d in day_names: # for d in day_names:
for h in hours: # for h in hours:
classes_of_same_year = [] # classes_of_same_year = []
for c in rooms: # for c in rooms:
for p in profs: # for p in profs:
#only want one class for each year to be taught at a time # #only want one class for each year to be taught at a time
for color_year in [cy for cy in courses if cy.color == n.color]: # for color_year in [cy for cy in courses if cy.color == n.color]:
classes_of_same_year.append(scheduled_classes[color_year, c, p, d, h]) # classes_of_same_year.append(scheduled_classes[color_year, c, p, d, h])
model.Add(sum(classes_of_same_year) <= 1) # model.Add(sum(classes_of_same_year) <= 1)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment