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

11/16/21 hard constraint form

parent d0f3c317
...@@ -116,28 +116,28 @@ ...@@ -116,28 +116,28 @@
<label for="Classroom">Choose a classroom:</label> <label for="Classroom">Choose a classroom:</label>
<select id="classroom" name="classroom"> <select id="classroom" name="classroom">
<option class="no-option" value="Please select an Option">Please select an Option</option> <option class="no-option" value="Please select an Option">Please select an Option</option>
<option value="DANA 113">DANA113</option> <option value="DANA113">DANA113</option>
<option value="DANA 115">DANA115</option> <option value="DANA115">DANA115</option>
<option value="DANA 117">DANA117</option> <option value="DANA117">DANA117</option>
<option value="DANA 132">DANA132</option> <option value="DANA132">DANA132</option>
<option value="DANA 134">DANA134</option> <option value="DANA134">DANA134</option>
<option value="DANA 137">DANA137</option> <option value="DANA137">DANA137</option>
<option value="DANA 214">DANA214</option> <option value="DANA214">DANA214</option>
<option value="DANA 221">DANA221</option> <option value="DANA221">DANA221</option>
<option value="DANA 227">DANA227</option> <option value="DANA227">DANA227</option>
<option value="DANA 319">DANA319</option> <option value="DANA319">DANA319</option>
<option value="DANA 325">DANA325</option> <option value="DANA325">DANA325</option>
<option value="DANA cc4">DANAcc4</option> <option value="DANAcc4">DANAcc4</option>
<option value="DANA cc6">DANAcc6</option> <option value="DANAcc6">DANAcc6</option>
<option value="BREAKIRON 65">BREAKIRON65</option> <option value="BREAKIRON65">BREAKIRON65</option>
<option value="BREAKIRON 66">BREAKIRON66</option> <option value="BREAKIRON66">BREAKIRON66</option>
<option value="BREAKIRON 165">BREAKIRON165</option> <option value="BREAKIRON165">BREAKIRON165</option>
<option value="BREAKIRON 166">BREAKIRON166</option> <option value="BREAKIRON166">BREAKIRON166</option>
<option value="BREAKIRON 264">BREAKIRON264</option> <option value="BREAKIRON264">BREAKIRON264</option>
<option value="ACADEMIC EAST 001">ACADEMIC EAST001</option> <option value="ACADEMIC EAST001">ACADEMIC EAST001</option>
<option value="ACADEMIC EAST 009">ACADEMIC EAST009</option> <option value="ACADEMIC EAST009">ACADEMIC EAST009</option>
<option value="ACADEMIC EAST 120">ACADEMIC EAST120</option> <option value="ACADEMIC EAST120">ACADEMIC EAST120</option>
<option value="ACADEMIC EAST 225">ACADEMIC EAST225</option> <option value="ACADEMIC EAST225">ACADEMIC EAST225</option>
</select> </select>
...@@ -59,16 +59,56 @@ def generate_schedule(): ...@@ -59,16 +59,56 @@ def generate_schedule():
scheduler.full_schedule() scheduler.full_schedule()
from backend.inputs import spring_2022_inputs
def parse_constraint(dict): def parse_constraint(dict):
keylist=[] keylist=[]
#creates all the keys
for item in dict: for item in dict:
keylist.append(item) keylist.append(item)
#creates all the values
for keys in keylist: for keys in keylist:
for values in dict.getlist(keys): for values in dict.getlist(keys):
print(values) valuelist.append(values)
# for i in range(len(dict.getlist("Day"))): #gets all the days
# print("model.Add(scheduled_classes[" + dict.getlist(keylist[1]) + "," + dict.getlist(keylist[2]) + "," + dict.getlist(keylist[1]) + "," + dict.getlist(keylist[3][i]) + "," + dict.getlist(keylist[4]) +"] == 1)") for day in dict.getlist("Day"):
#find index of the class from inputs
print("searching for " + valuelist[1])
for i in range(len(spring_2022_inputs.classes)):
if spring_2022_inputs.classes[i][0] == valuelist[1]:
class_index = i
# find index of the room from inputs
print("searching for " + valuelist[2])
for i in range(len(spring_2022_inputs.classrooms)):
if spring_2022_inputs.classrooms[i][0] == valuelist[2]:
room_index = i
# find index of the prof from inputs
print("searching for " + valuelist[0])
for i in range(len(spring_2022_inputs.professors)):
if spring_2022_inputs.professors[i][0] == valuelist[0]:
prof_index = i
# #make the model.add command
# 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)")
if __name__ == "__main__": if __name__ == "__main__":, port=9000, host=""), port=9000, host="")
\ No newline at end of file
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