Timetabler
|
Class for constraint adder. More...
#include <constraint_adder.h>
Public Member Functions | |
ConstraintAdder (ConstraintEncoder *, Timetabler *) | |
Constructs the ConstraintAdder object. More... | |
void | addConstraints () |
Adds all the constraints with their respective weights using the Timetabler object to the solver. | |
void | addSingleConstraint (PredefinedClauses, const Clauses &, const int course) |
Adds a single predefined constraint to the solver. More... | |
Class for constraint adder.
This class is responsible for interpreting each constraint at a high level and creating clauses to represent them. This class contains functions each which represents a high level constraint. In the function, courses are iterated over and calls are made to an object of ConstraintEncoder to get Clauses corresponding to lower level constraints for a given course, which are then joined together using the defined operations. It also contains functions to add these predefined constraints with their prescribed weights to the Timetabler, which then adds it to the solver.
Definition at line 26 of file constraint_adder.h.
ConstraintAdder::ConstraintAdder | ( | ConstraintEncoder * | encoder, |
Timetabler * | timetabler | ||
) |
Constructs the ConstraintAdder object.
encoder | The encoder |
timetabler | The time tabler |
Definition at line 20 of file constraint_adder.cpp.
References Clauses::addClauses(), Clauses::clear(), Data::courses, Timetabler::data, and timetabler.
void ConstraintAdder::addSingleConstraint | ( | PredefinedClauses | clauseType, |
const Clauses & | clauses, | ||
const int | course | ||
) |
Adds a single predefined constraint to the solver.
[in] | clauseType | The PredefinedClauses member denoting the constraint type |
[in] | clauses | The clauses to be added |
[in] | course | The corresponding course index (-1 for if there is no corresponding course) |
Definition at line 177 of file constraint_adder.cpp.
References Timetabler::addClauses(), Timetabler::addHighLevelConstraintClauses(), Timetabler::data, Data::predefinedClausesWeights, Data::predefinedConstraintVars, and timetabler.