31 Student(
size_t nrFaculty,
size_t advisorIndex)
32 : keys_(3), areaName_(3), advisor_(nrFaculty, 1.0) {
33 advisor_[advisorIndex] = 0.0;
37 cout << name_ <<
": ";
38 for (
size_t area = 0; area < 3; area++) cout << areaName_[area] <<
" ";
51 std::vector<std::string> facultyName_,
slotName_, areaName_;
69 Scheduler(
size_t maxNrStudents) : maxNrStudents_(maxNrStudents) {}
75 facultyIndex_[facultyName] = nrFaculty();
76 facultyName_.push_back(facultyName);
79 size_t nrFaculty()
const {
return facultyName_.size(); }
84 void addSlot(
const std::string& slotName) { slotName_.push_back(slotName); }
88 const std::string&
slotName(
size_t s)
const {
return slotName_[
s]; }
92 slotsAvailable_ = slotsAvailable;
95 void addArea(
const std::string& facultyName,
const std::string& areaName) {
96 areaName_.push_back(areaName);
97 std::vector<double>&
table =
98 facultyInArea_[areaName];
99 if (
table.empty())
table.resize(nrFaculty(), 0);
100 table[facultyIndex_[facultyName]] = 1;
111 std::optional<size_t> area = {})
const;
114 void addStudent(
const std::string& studentName,
const std::string& area1,
115 const std::string& area2,
const std::string& area3,
116 const std::string& advisor);
121 const std::string& studentName(
size_t i)
const;
123 const std::string& studentArea(
size_t i,
size_t area)
const;
126 void addStudentSpecificConstraints(
127 size_t i, std::optional<size_t> slot = {});
130 void buildGraph(
size_t mutexBound = 7);
134 const std::string&
s =
"Scheduler",
145 std::vector<size_t>&
stats)
const;