32 Student(
size_t nrFaculty,
size_t advisorIndex) :
33 keys_(3), areaName_(3), advisor_(nrFaculty, 1.0) {
34 advisor_[advisorIndex] = 0.0;
38 cout << name_ <<
": ";
39 for (
size_t area = 0; area < 3; area++)
40 cout << areaName_[area] <<
" ";
53 std::vector<std::string> facultyName_,
slotName_, areaName_;
72 Scheduler(
size_t maxNrStudents) : maxNrStudents_(maxNrStudents) {}
78 facultyIndex_[facultyName] = nrFaculty();
79 facultyName_.push_back(facultyName);
83 return facultyName_.size();
88 available_ = available;
91 void addSlot(
const std::string& slotName) {
92 slotName_.push_back(slotName);
96 return slotName_.size();
105 slotsAvailable_ = slotsAvailable;
108 void addArea(
const std::string& facultyName,
const std::string& areaName) {
109 areaName_.push_back(areaName);
110 std::vector<double>&
table = facultyInArea_[areaName];
111 if (table.empty()) table.resize(nrFaculty(), 0);
112 table[facultyIndex_[facultyName]] = 1;
122 const DiscreteKey&
key(
size_t s, boost::optional<size_t> area = boost::none)
const;
125 void addStudent(
const std::string& studentName,
const std::string& area1,
126 const std::string& area2,
const std::string& area3,
127 const std::string& advisor);
131 return students_.size();
134 const std::string& studentName(
size_t i)
const;
136 const std::string& studentArea(
size_t i,
size_t area)
const;
139 void addStudentSpecificConstraints(
size_t i, boost::optional<size_t> slot = boost::none);
142 void buildGraph(
size_t mutexBound = 7);
146 const std::string& s =
"Scheduler",
157 std::vector<size_t>&
stats)
const;
const std::string & slotName(size_t s) const
void print(const Matrix &A, const string &s, ostream &stream)
Scheduler(size_t maxNrStudents)
std::map< std::string, size_t > facultyIndex_
std::vector< std::string > slotName_
std::vector< DiscreteKey > keys_
void setAvailability(const std::string &available)
size_t nrTimeSlots() const
size_t nrStudents() const
current number of students
static const KeyFormatter DefaultKeyFormatter
const KeyFormatter & formatter
Student(size_t nrFaculty, size_t advisorIndex)
std::vector< double > advisor_
virtual ~Scheduler()
Destructor.
void addStudent(Scheduler &s, size_t i)
std::pair< Key, size_t > DiscreteKey
std::vector< Student > students_
FacultyInArea facultyInArea_
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
void addSlot(const std::string &slotName)
void setSlotsAvailable(const std::vector< double > &slotsAvailable)
std::vector< std::string > areaName_
boost::shared_ptr< This > shared_ptr
void addArea(const std::string &facultyName, const std::string &areaName)
void addFaculty(const std::string &facultyName)
std::map< std::string, std::vector< double > > FacultyInArea
boost::shared_ptr< Values > sharedValues
std::vector< double > slotsAvailable_