Skip to content

Commit c70a9cb

Browse files
committed
Changed population to be closer to average ✏️
1 parent c01ed5a commit c70a9cb

File tree

2 files changed

+17
-43
lines changed

2 files changed

+17
-43
lines changed

include/simulation.hh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
#include <sys/stat.h>
4646

4747
// Population sizes (http://www.yrdsb.ca/AboutUs/DirectorsAnnualReport/Documents/2018-19-Sec.pdf)
48-
const int kGrade9Population = 292;
49-
const int kGrade10Population = 356;
50-
const int kGrade11Population = 372;
51-
const int kGrade12Population = 334;
48+
const int kGrade9Population = 288;
49+
const int kGrade10Population = 290;
50+
const int kGrade11Population = 308;
51+
const int kGrade12Population = 351;
5252

5353
// Period times
5454
const int kPreClass = 500;

src/configure_agents.cpp

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -35,67 +35,41 @@ void assign_student_timetables(std::vector<Agent> &agent_vector, int grade) {
3535
{ // Grade 9
3636
{"304", "115", "223", "345", "227", "226", "211", "108", "340", "312", "GYMA", "319", "145", "334"}, // p1
3737
{"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
3938
{"111", "150", "112", "210", "226", "146", "346", "320"}, // p4
4039
{"GYMA", "345", "304", "211", "LIBSEM", "GYMB", "320", "214", "227", "205"} // p5
4140
},
4241
{ // Grade 10
4342
{"337", "316", "146", "327", "314", "111", "208", "338", "326", "303", "107", "213"}, // p1
4443
{"329", "337", "312", "106", "333", "112", "305", "345", "316", "303", "327", "211", "145", "310", "213",
4544
"336"}, // p2
46-
{"111", "328", "146", "303", "305", "214", "310", "205", "319", "210"}, // p3
4745
{"337", "GYMB", "WEIGH", "227", "223", "213", "303", "312", "302"}, // p4
4846
{"107", "150", "112", "106", "333", "317", "WEIGH", "303", "226"} // p5
4947
},
5048
{ // 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
5653
},
5754
{ // 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
6359
}
6460
};
6561

6662
for (auto &student : agent_vector) {
6763
// Assign the student to some classes
6864
student.p1 = *random_element(student_courses[grade][0].begin(), student_courses[grade][0].end());
6965
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());
7369

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;
7871

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;
9973
}
10074

10175
}

0 commit comments

Comments
 (0)