Back to index

fet  5.18.0
Public Member Functions | Public Attributes
SpaceConstraint Class Reference

This class represents a space constraint. More...

#include <spaceconstraint.h>

Inheritance diagram for SpaceConstraint:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 SpaceConstraint ()
 Dummy constructor - needed for the static array of constraints.
virtual ~SpaceConstraint ()=0
 SpaceConstraint (double wp)
 Constructor - please note that the maximum allowed weight is 100.0 The reason: unallocated activities must have very big conflict weight, and any other restrictions must have much more lower weight, so that the timetable can evolve when starting with uninitialized activities.
virtual double fitness (Solution &c, Rules &r, QList< double > &cl, QList< QString > &dl, QString *conflictsString=NULL)=0
 The function that calculates the fitness of a solution, according to this constraint.
virtual QString getXmlDescription (Rules &r)=0
 Returns an XML description of this constraint.
virtual bool computeInternalStructure (QWidget *parent, Rules &r)=0
 Computes the internal structure for this constraint.
virtual bool hasInactiveActivities (Rules &r)=0
virtual QString getDescription (Rules &r)=0
 Returns a small description string for this constraint.
virtual QString getDetailedDescription (Rules &r)=0
 Returns a detailed description string for this constraint.
virtual bool isRelatedToActivity (Activity *a)=0
 Returns true if this constraint is related to this activity.
virtual bool isRelatedToTeacher (Teacher *t)=0
 Returns true if this constraint is related to this teacher.
virtual bool isRelatedToSubject (Subject *s)=0
 Returns true if this constraint is related to this subject.
virtual bool isRelatedToActivityTag (ActivityTag *s)=0
 Returns true if this constraint is related to this activity tag.
virtual bool isRelatedToStudentsSet (Rules &r, StudentsSet *s)=0
 Returns true if this constraint is related to this students set.
virtual bool isRelatedToRoom (Room *r)=0
 Returns true if this constraint is related to this room.
virtual bool hasWrongDayOrHour (Rules &r)=0
virtual bool canRepairWrongDayOrHour (Rules &r)=0
virtual bool repairWrongDayOrHour (Rules &r)=0

Public Attributes

double weightPercentage
 The weight (percentage) of this constraint.
bool active
QString comments
int type
 Specifies the type of this constraint (using the above constants).

Detailed Description

This class represents a space constraint.

Definition at line 93 of file spaceconstraint.h.


Constructor & Destructor Documentation

Dummy constructor - needed for the static array of constraints.

Use of this function must be avoided.

Definition at line 75 of file spaceconstraint.cpp.

{
       type=CONSTRAINT_GENERIC_SPACE;
       
       active=true;
       comments=QString("");
}

Definition at line 83 of file spaceconstraint.cpp.

{
}

Constructor - please note that the maximum allowed weight is 100.0 The reason: unallocated activities must have very big conflict weight, and any other restrictions must have much more lower weight, so that the timetable can evolve when starting with uninitialized activities.

Definition at line 87 of file spaceconstraint.cpp.

{
       type=CONSTRAINT_GENERIC_SPACE;

       weightPercentage=wp;
       assert(wp<=100 && wp>=0);

       active=true;
       comments=QString("");
}

Member Function Documentation

virtual bool SpaceConstraint::canRepairWrongDayOrHour ( Rules r) [pure virtual]
virtual bool SpaceConstraint::computeInternalStructure ( QWidget *  parent,
Rules r 
) [pure virtual]
virtual double SpaceConstraint::fitness ( Solution c,
Rules r,
QList< double > &  cl,
QList< QString > &  dl,
QString *  conflictsString = NULL 
) [pure virtual]
virtual QString SpaceConstraint::getDescription ( Rules r) [pure virtual]
virtual QString SpaceConstraint::getDetailedDescription ( Rules r) [pure virtual]
virtual QString SpaceConstraint::getXmlDescription ( Rules r) [pure virtual]
virtual bool SpaceConstraint::hasInactiveActivities ( Rules r) [pure virtual]
virtual bool SpaceConstraint::hasWrongDayOrHour ( Rules r) [pure virtual]
virtual bool SpaceConstraint::isRelatedToActivity ( Activity a) [pure virtual]
virtual bool SpaceConstraint::isRelatedToActivityTag ( ActivityTag s) [pure virtual]
virtual bool SpaceConstraint::isRelatedToRoom ( Room r) [pure virtual]
virtual bool SpaceConstraint::isRelatedToStudentsSet ( Rules r,
StudentsSet s 
) [pure virtual]
virtual bool SpaceConstraint::isRelatedToSubject ( Subject s) [pure virtual]
virtual bool SpaceConstraint::isRelatedToTeacher ( Teacher t) [pure virtual]
virtual bool SpaceConstraint::repairWrongDayOrHour ( Rules r) [pure virtual]

Member Data Documentation

Definition at line 102 of file spaceconstraint.h.

Definition at line 104 of file spaceconstraint.h.

Specifies the type of this constraint (using the above constants).

Definition at line 109 of file spaceconstraint.h.

The weight (percentage) of this constraint.

Definition at line 100 of file spaceconstraint.h.


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