Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Thomas Stone
BucknellScheduler
Commits
fb0db627
Commit
fb0db627
authored
Nov 18, 2021
by
Jack Otto
Browse files
11/18/21 wendy chnage
parent
ba0fae6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
backend/scheduler/scheduler.py
View file @
fb0db627
...
...
@@ -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"
,
"14"
]
==
0
)
print
(
"Adding constraint to not schedule classes of same color at the same times"
)
for
n
in
courses
:
for
d
in
day_names
:
for
h
in
hours
:
classes_of_same_year
=
[]
for
c
in
rooms
:
for
p
in
profs
:
#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
]:
classes_of_same_year
.
append
(
scheduled_classes
[
color_year
,
c
,
p
,
d
,
h
])
model
.
Add
(
sum
(
classes_of_same_year
)
<=
1
)
#
print("Adding constraint to not schedule classes of same color at the same times")
#
for n in courses:
#
for d in day_names:
#
for h in hours:
#
classes_of_same_year = []
#
for c in rooms:
#
for p in profs:
#
#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]:
#
classes_of_same_year.append(scheduled_classes[color_year, c, p, d, h])
#
model.Add(sum(classes_of_same_year) <= 1)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment