Timetabler
Public Member Functions | Public Attributes | List of all members
Data Class Reference

Class for data. More...

#include <data.h>

Public Member Functions

 Data ()
 Constructs the Data object. More...
 

Public Attributes

std::vector< Coursecourses
 
std::vector< Instructorinstructors
 
std::vector< Classroomclassrooms
 
std::vector< Programprograms
 
std::vector< Segmentsegments
 
std::vector< Slotslots
 
std::vector< IsMinorisMinors
 
std::vector< std::vector< std::vector< Var > > > fieldValueVars
 
std::vector< std::vector< Var > > highLevelVars
 
std::vector< std::vector< Var > > predefinedConstraintVars
 
std::vector< Var > customConstraintVars
 
std::vector< std::vector< std::vector< lbool > > > existingAssignmentVars
 
std::vector< int > highLevelVarWeights
 
std::vector< int > existingAssignmentWeights
 
std::vector< int > predefinedClausesWeights
 
std::map< int, unsigned > customMap
 

Detailed Description

Class for data.

This represents all the data taken from the input. This contains the list of all the allowed field values for each FieldType, the variables for each (Course, FieldType, field value), the high level variables used for providing reasons if a time table could not be created, the existing assignments given in the input, and the weights of every constraint and exisiting assignment. Most of this data is populated by the Parser after parsing fields and inputs.

Definition at line 31 of file data.h.

Constructor & Destructor Documentation

◆ Data()

Data::Data ( )

Constructs the Data object.

This fills in the default weight values for all the clauses. Other members are left uninitialized and are filled in by the Parser.

Definition at line 11 of file data.cpp.

References existingAssignmentWeights, Global::FIELD_COUNT, highLevelVarWeights, Global::PREDEFINED_CLAUSES_COUNT, and predefinedClausesWeights.

Member Data Documentation

◆ classrooms

std::vector<Classroom> Data::classrooms

Stores objects for each possible Classroom

Definition at line 44 of file data.h.

Referenced by Parser::addVars().

◆ courses

std::vector<Course> Data::courses

Stores objects for each Course in the input

Definition at line 36 of file data.h.

Referenced by Parser::addVars(), ConstraintAdder::ConstraintAdder(), and Parser::verify().

◆ customConstraintVars

std::vector<Var> Data::customConstraintVars

Stores the high level variables associated with the custom constraints.

Definition at line 89 of file data.h.

◆ customMap

std::map<int, unsigned> Data::customMap

Stores the course with the associated custom constraint.

Definition at line 128 of file data.h.

◆ existingAssignmentVars

std::vector<std::vector<std::vector<lbool> > > Data::existingAssignmentVars

Stores the existing assignments for every Course and FieldType as given in the input. This is of the form (Course, FieldType, field value), where if assigned true, the element is assigned l_True, and if false, is assigned l_False. If no assignment is given, such as for a Classroom or a Slot, the assigned value is l_Undef.

Definition at line 98 of file data.h.

Referenced by Parser::parseInput().

◆ existingAssignmentWeights

std::vector<int> Data::existingAssignmentWeights

Stores the weights for the existing assignments given by the user in the input. This represents the weight that must be given in the soft clauses that ask that the value assigned be the value that the user gave as input. Negative weights imply the clause is hard, and a zero weight implies that the input can be ignored completely.

Definition at line 116 of file data.h.

Referenced by Data().

◆ fieldValueVars

std::vector<std::vector<std::vector<Var> > > Data::fieldValueVars

Stores the primary variables used in the solver. The variables are in a 3D vector form. They can be represented as a 3-tuple, (Course, FieldType, field value), where the first two dimensions represent the Course and the FieldType the variable represents, and the third dimension represents which field value of the given FieldType, out of the allowed field values, the variable corresponds to. These variables are added to the solver by the Parser.

Definition at line 73 of file data.h.

Referenced by ConstraintEncoder::ConstraintEncoder().

◆ highLevelVars

std::vector<std::vector<Var> > Data::highLevelVars

Stores the high level variables. It is of the form (Course, FieldType). If an assignment for a given FieldType for the given Course could not be made, this will be False, and is given as output so that the user can make the necessary changes.

Definition at line 81 of file data.h.

◆ highLevelVarWeights

std::vector<int> Data::highLevelVarWeights

Stores the weights for the high level variables of each FieldType. This represents the weight that must be given to soft clauses which ensure that a value is found for each FieldType for every Course. Negative weights imply the clause is hard, and a zero weight implies that the input can be ignored completely.

Definition at line 107 of file data.h.

Referenced by Data().

◆ instructors

std::vector<Instructor> Data::instructors

Stores objects for each possible Instructor

Definition at line 40 of file data.h.

◆ isMinors

std::vector<IsMinor> Data::isMinors

Stores objects for each possible IsMinor value

Definition at line 60 of file data.h.

◆ predefinedClausesWeights

std::vector<int> Data::predefinedClausesWeights

Stores the weights for the predefined clauses for the time tabling problem. These have default values -1 for the default hard constraints, and 1 for the soft constraints. Changing these can be used to toggle between hard and soft or to disable certain constraints.

Definition at line 124 of file data.h.

Referenced by ConstraintAdder::addConstraints(), ConstraintAdder::addSingleConstraint(), Data(), and Parser::verify().

◆ predefinedConstraintVars

std::vector<std::vector<Var> > Data::predefinedConstraintVars

Stores the high level variables associated with the predefined constraints.

Definition at line 85 of file data.h.

Referenced by ConstraintAdder::addSingleConstraint().

◆ programs

std::vector<Program> Data::programs

Stores objects for each possible Program

Definition at line 48 of file data.h.

◆ segments

std::vector<Segment> Data::segments

Stores objects for each possible Segment

Definition at line 52 of file data.h.

◆ slots

std::vector<Slot> Data::slots

Stores objects for each possible Slot

Definition at line 56 of file data.h.

Referenced by Parser::verify().


The documentation for this class was generated from the following files: