Back to index

fet  5.18.0
Functions | Variables
timeconstraint.cpp File Reference
#include "timetable_defs.h"
#include "timeconstraint.h"
#include "rules.h"
#include "solution.h"
#include "activity.h"
#include "teacher.h"
#include "subject.h"
#include "activitytag.h"
#include "studentsset.h"
#include "matrix.h"
#include <QString>
#include <QMessageBox>
#include <QSet>
#include <algorithm>

Go to the source code of this file.

Functions

static QString trueFalse (bool x)
static QString yesNoTranslated (bool x)
QString getActivityDetailedDescription (Rules &r, int id)

Variables

static Matrix3D< qint8 > subgroupsMatrix
static Matrix3D< qint8 > teachersMatrix
static int teachers_conflicts = -1
static int subgroups_conflicts = -1
Matrix2D< bool > breakDayHour
Matrix3D< bool > teacherNotAvailableDayHour
Matrix3D< bool > subgroupNotAvailableDayHour

Function Documentation

QString getActivityDetailedDescription ( Rules r,
int  id 
)

Definition at line 85 of file timeconstraint.cpp.

                                                        {
       QString s;

       int ai;
       for(ai=0; ai<r.activitiesList.size(); ai++)
              if(r.activitiesList[ai]->id==id)
                     break;
       
       if(ai==r.activitiesList.size()){
              s+=QCoreApplication::translate("Activity", "Invalid (inexistent) id for activity");
              return s;
       }
       assert(ai<r.activitiesList.size());
       
       Activity* act=r.activitiesList.at(ai);
       
       if(act->activityTagsNames.count()>0){
              s+=QCoreApplication::translate("Activity", "T:%1, S:%2, AT:%3, St:%4", "This is an important translation for an activity's detailed description, please take care (it appears in many places in constraints)."
               "The abbreviations are: Teachers, Subject, Activity tags, Students. This variant includes activity tags").arg(act->teachersNames.join(",")).arg(act->subjectName).arg(act->activityTagsNames.join(",")).arg(act->studentsNames.join(","));
       }
       else{
              s+=QCoreApplication::translate("Activity", "T:%1, S:%2, St:%3", "This is an important translation for an activity's detailed description, please take care (it appears in many places in constraints)."
               "The abbreviations are: Teachers, Subject, Students. There are no activity tags here").arg(act->teachersNames.join(",")).arg(act->subjectName).arg(act->studentsNames.join(","));
       }
       return s;
}
static QString trueFalse ( bool  x) [static]

Definition at line 47 of file timeconstraint.cpp.

                                {
       if(!x)
              return QString("false");
       else
              return QString("true");
}
static QString yesNoTranslated ( bool  x) [static]

Definition at line 54 of file timeconstraint.cpp.

                                      {
       if(!x)
              return QCoreApplication::translate("TimeConstraint", "no", "no - meaning negation");
       else
              return QCoreApplication::translate("TimeConstraint", "yes", "yes - meaning affirmative");
}

Variable Documentation

Definition at line 92 of file generate_pre.cpp.

Definition at line 95 of file generate_pre.cpp.

int subgroups_conflicts = -1 [static]

Definition at line 70 of file timeconstraint.cpp.

Matrix3D<qint8> subgroupsMatrix [static]

Definition at line 66 of file timeconstraint.cpp.

Definition at line 98 of file generate_pre.cpp.

int teachers_conflicts = -1 [static]

Definition at line 69 of file timeconstraint.cpp.

Matrix3D<qint8> teachersMatrix [static]

Definition at line 67 of file timeconstraint.cpp.