@@ -35,67 +35,41 @@ void assign_student_timetables(std::vector<Agent> &agent_vector, int grade) {
35
35
{ // Grade 9
36
36
{" 304" , " 115" , " 223" , " 345" , " 227" , " 226" , " 211" , " 108" , " 340" , " 312" , " GYMA" , " 319" , " 145" , " 334" }, // p1
37
37
{" 304" , " 210" , " GYMA" , " 227" , " 150" , " 320" , " 226" , " 340" , " GYMB" , " 319" , " 205" , " 115" }, // p2
38
- {" 302" , " 316" , " 340" , " 210" , " 107" , " 327" , " 106" , " 340" , " 312" , " 115" }, // p3
39
38
{" 111" , " 150" , " 112" , " 210" , " 226" , " 146" , " 346" , " 320" }, // p4
40
39
{" GYMA" , " 345" , " 304" , " 211" , " LIBSEM" , " GYMB" , " 320" , " 214" , " 227" , " 205" } // p5
41
40
},
42
41
{ // Grade 10
43
42
{" 337" , " 316" , " 146" , " 327" , " 314" , " 111" , " 208" , " 338" , " 326" , " 303" , " 107" , " 213" }, // p1
44
43
{" 329" , " 337" , " 312" , " 106" , " 333" , " 112" , " 305" , " 345" , " 316" , " 303" , " 327" , " 211" , " 145" , " 310" , " 213" ,
45
44
" 336" }, // p2
46
- {" 111" , " 328" , " 146" , " 303" , " 305" , " 214" , " 310" , " 205" , " 319" , " 210" }, // p3
47
45
{" 337" , " GYMB" , " WEIGH" , " 227" , " 223" , " 213" , " 303" , " 312" , " 302" }, // p4
48
46
{" 107" , " 150" , " 112" , " 106" , " 333" , " 317" , " WEIGH" , " 303" , " 226" } // p5
49
47
},
50
48
{ // Grade 11
51
- {" 328" , " 310" , " 150" , " 112" , " 305" , " 214" , " 302" , " 106" , " GYMB" , " 317" , " 336" , " LUNCH" }, // p1
52
- {" 111" , " 208" , " 317" , " 214" , " 346" , " 107" , " 334" , " 302" , " 336" , " 334" , " 302" , " LUNCH" }, // p2
53
- {" 304" , " 314" , " 208" , " 326" , " WEIGH" , " 226" , " 337" , " 319" , " 211" , " 220" , " 145" , " 213" , " LUNCH" }, // p3
54
- {" 345" , " 338" , " 333" , " 211" , " 214" , " 145" , " 220" , " 317" , " LUNCH" }, // p4
55
- {" 328" , " 310" , " 314" , " 326" , " 111" , " 305" , " 223" , " 146" , " 337" , " LUNCH" } // p5
49
+ {" 328" , " 310" , " 150" , " 112" , " 305" , " 214" , " 302" , " 106" , " GYMB" , " 317" , " 336" }, // p1
50
+ {" 111" , " 208" , " 317" , " 214" , " 346" , " 107" , " 334" , " 302" , " 336" , " 334" , " 302" }, // p2
51
+ {" 345" , " 338" , " 333" , " 211" , " 214" , " 145" , " 220" , " 317" }, // p4
52
+ {" 328" , " 310" , " 314" , " 326" , " 111" , " 305" , " 223" , " 146" , " 337" ,} // p5
56
53
},
57
54
{ // Grade 12
58
- {" 329" , " 301" , " 210" , " 333" , " WEIGH" , " 346" , " 320" , " 220" , " LUNCH" }, // p1
59
- {" 326" , " 338" , " 328" , " 223" , " WEIGH" , " 301" , " 146" , " LUNCH" }, // p2
60
- {" 150" , " 312" , " 333" , " 320" , " 227" , " 301" , " 346" , " 213" , " 317" , " 145" , " 220" , " LUNCH" }, // p3
61
- {" 310" , " 314" , " 106" , " 301" , " 316" , " 327" , " 340" , " 328" , " 336" , " LUNCH" }, // p4
62
- {" 338" , " 208" , " 316" , " 327" , " 346" , " 301" , " LUNCH" , " LUNCH" } // p5
55
+ {" 329" , " 301" , " 210" , " 333" , " WEIGH" , " 346" , " 320" , " 220" }, // p1
56
+ {" 326" , " 338" , " 328" , " 223" , " WEIGH" , " 301" , " 146" }, // p2
57
+ {" 310" , " 314" , " 106" , " 301" , " 316" , " 327" , " 340" , " 328" , " 336" , " WEIGH" }, // p4
58
+ {" 338" , " 208" , " 316" , " 327" , " 346" , " 301" , " 150" , " 312" } // p5
63
59
}
64
60
};
65
61
66
62
for (auto &student : agent_vector) {
67
63
// Assign the student to some classes
68
64
student.p1 = *random_element (student_courses[grade][0 ].begin (), student_courses[grade][0 ].end ());
69
65
student.p2 = *random_element (student_courses[grade][1 ].begin (), student_courses[grade][1 ].end ());
70
- student.p3 = *random_element (student_courses[grade][2 ].begin (), student_courses[grade][2 ].end ());
71
- student.p4 = *random_element (student_courses[grade][3 ].begin (), student_courses[grade][3 ].end ());
72
- student.p5 = *random_element (student_courses[grade][4 ].begin (), student_courses[grade][4 ].end ());
66
+ // student.p3 = *random_element(student_courses[grade][2].begin(), student_courses[grade][2].end());
67
+ student.p4 = *random_element (student_courses[grade][2 ].begin (), student_courses[grade][2 ].end ());
68
+ student.p5 = *random_element (student_courses[grade][3 ].begin (), student_courses[grade][3 ].end ());
73
69
74
- // Give the student a lunch
75
- // If the student is in grade 9 or 10, give them a lunch in P3 or P4
76
- int lunch_period;
77
- std::vector<int > possible_lunch_periods;
70
+ student.p3 = kLunchVar ;
78
71
79
- if (grade == 0 or grade == 1 )
80
- possible_lunch_periods = {3 , 4 };
81
- else
82
- possible_lunch_periods = {1 , 2 , 3 , 4 , 5 };
83
-
84
- // SUPER overkill way of generating a random number
85
- lunch_period = *random_element (possible_lunch_periods.begin (), possible_lunch_periods.end ());
86
-
87
- if (lunch_period == 1 )
88
- student.p1 = kLunchVar ;
89
- else if (lunch_period == 2 )
90
- student.p2 = kLunchVar ;
91
- else if (lunch_period == 3 )
92
- student.p3 = kLunchVar ;
93
- else if (lunch_period == 4 )
94
- student.p4 = kLunchVar ;
95
- else if (lunch_period == 5 )
96
- student.p5 = kLunchVar ;
97
-
98
- student.lunch_period = lunch_period - 1 ;
72
+ student.lunch_period = 2 ;
99
73
}
100
74
101
75
}
0 commit comments