Commit 0936a833 authored by Jack Otto's avatar Jack Otto
Browse files

11/17/21 working with constraint form

parent 6680a79d
......@@ -78,14 +78,3 @@ def delete_events():
file = open("./backend/scheduler/eventID.txt", "w")
file.close()
# if __name__ == '__main__':
# # TESTING
# from schedule_objects import Course, Professor, Room
# course = Course('Test101', 20, 'Computers', 2, ['Mo', 'We', 'Fr'])
# prof = Professor('Thomas', 2, ['Test101'])
# room = Room('Room101', 25, 'Computers', ['Mo10'])
# day = 'We'
# hour = '09'
#
# sched_class = ScheduleObject(course, room, prof, day, hour)
......@@ -83,6 +83,7 @@ def parse_constraint(dict):
for day in dict.getlist("Day"):
daylist.append(day)
global class_index
#find index of the class from inputs
print("searching for " + valuelist[1])
for i in range(len(spring_2022_inputs.classes)):
......@@ -91,6 +92,7 @@ def parse_constraint(dict):
print(class_index)
break
global room_index
# find index of the room from inputs
print("searching for " + valuelist[2])
for i in range(len(spring_2022_inputs.classrooms)):
......@@ -99,6 +101,7 @@ def parse_constraint(dict):
print(room_index)
break
global prof_index
# find index of the prof from inputs
print("searching for " + valuelist[0])
for i in range(len(spring_2022_inputs.professors)):
......@@ -109,9 +112,9 @@ def parse_constraint(dict):
# #make the model.add command
# for i in range(len(daylist)):
for i in range(len(daylist)):
# model.Add(scheduled_classes[(courses[1], rooms[0], profs[4], "Mo", "10")] == 1)
# print("model.Add(scheduled_classes[(" + valuelist[1] + "," + valuelist[2] + "," + valuelist[0] + "," + daylist[i] + "," + valuelist[3+len(daylist)] + ")] == 1)")
print("model.Add(scheduled_classes[(courses[" + str(class_index) + "], rooms[" + str(room_index) + "], profs[" + str(prof_index) + "], " + '"' + daylist[i] + '"' + ", " + '"' + valuelist[3+len(daylist)] + '"' + ")] == 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