📄 rules.h
字号:
or -1 if not found. */ int searchSubjectTag(const QString& subjectTagName); /** Removes this subject tag. In the list of activities, the subject tag will be removed from all activities which posess it. It returns false on failure. If successful, returns true. */ bool removeSubjectTag(const QString& subjectTagName); /** Modifies (renames) this subject tag and takes care of all related activities. Returns true on success, false on failure (if not found) */ bool modifySubjectTag(const QString& initialSubjectTagName, const QString& finalSubjectTagName); /** A function to sort the subject tags alphabetically */ void sortSubjectTagsAlphabetically(); /** Returns a pointer to the structure containing this student container (year, group or subgroup) or NULL. */ StudentsSet* searchStudentsSet(const QString& setName); /** True if the students sets contain one common subgroup. This function is used in constraints isRelatedToStudentsSet */ bool studentsSetsRelated(const QString& studentsSet1, const QString& studentsSet2); /** Adds a new year of study to the academic structure */ bool addYear(StudentsYear* year); bool removeYear(const QString& yearName); /** Returns -1 if not found or the index of this year in the years list */ int searchYear(const QString& yearName); /** Modifies this students year (name, number of students) and takes care of all related activities and constraints. Returns true on success, false on failure (if not found) */ bool modifyYear(const QString& initialYearName, const QString& finalYearName, int finalNumberOfStudents); /** A function to sort the years alphabetically */ void sortYearsAlphabetically(); /** Adds a new group in a certain year of study to the academic structure */ bool addGroup(const QString& yearName, StudentsGroup* group); bool removeGroup(const QString& yearName, const QString& groupName); /** Returns -1 if not found or the index of this group in the groups list of this year. */ int searchGroup(const QString& yearName, const QString& groupName); /** Modifies this students group (name, number of students) and takes care of all related activities and constraints. Returns true on success, false on failure (if not found) */ bool modifyGroup(const QString& yearName, const QString& initialGroupName, const QString& finalGroupName, int finalNumberOfStudents); /** A function to sort the groups of this year alphabetically */ void sortGroupsAlphabetically(const QString& yearName); /** Adds a new subgroup to a certain group in a certain year of study to the academic structure */ bool addSubgroup(const QString& yearName, const QString& groupName, StudentsSubgroup* subgroup); bool removeSubgroup(const QString& yearName, const QString& groupName, const QString& subgroupName); /** Returns -1 if not found or the index of the subgroup in the list of subgroups of this group */ int searchSubgroup(const QString& yearName, const QString& groupName, const QString& subgroupName); /** Modifies this students subgroup (name, number of students) and takes care of all related activities and constraints. Returns true on success, false on failure (if not found) */ bool modifySubgroup(const QString& yearName, const QString& groupName, const QString& initialSubgroupName, const QString& finalSubgroupName, int finalNumberOfStudents); /** A function to sort the subgroups of this group alphabetically */ void sortSubgroupsAlphabetically(const QString& yearName, const QString& groupName); /** Adds a new indivisible activity (not split) to the list of activities. (It can add a subactivity of a split activity) Returns true if successful or false if the maximum number of activities was reached. There is automatically added a ConstraintActivityPreferredTime, if necessary */ bool addSimpleActivity( int _id, int _activityGroupId, const QStringList& _teachersNames, const QString& _subjectName, const QString& _subjectTagName, const QStringList& _studentsNames, int _duration, /*duration, in hours*/ int _totalDuration, int _parity, /*parity: PARITY_WEEKLY or PARITY_BIWEEKLY*/ bool _active, int _preferredDay, int _preferredHour); /** Adds a new split activity to the list of activities. Returns true if successful or false if the maximum number of activities was reached. If _minDayDistance>0, there will automatically added a compulsory ConstraintMinNDaysBetweenActivities. Also, there are automatically added several ConstraintActivityPreferredTime, if necessary */ bool addSplitActivity( int _firstActivityId, int _activityGroupId, const QStringList& _teachersNames, const QString& _subjectName, const QString& _subjectTagName, const QStringList& _studentsNames, int _nSplits, int _totalDuration, int _durations[], int _parities[], bool _active[], int _minDayDistance, int _preferredDays[], int _preferredHours[]); /** Removes only the activity with this id. */ void removeActivity(int _id); /** If _activityGroupId==0, then this is a non-split activity (if >0, then this is a single sub-activity from a split activity. Removes this activity from the list of activities. For split activities, it removes all the sub-activities that are contained in it. */ void removeActivity(int _id, int _activityGroupId); /** A function to modify the information of a certain activity. If this is a sub-activity of a split activity, all the sub-activities will be modified. */ void modifyActivity( int _id, int _activityGroupId, const QStringList& _teachersNames, const QString& _subjectName, const QString& _subjectTagName, const QStringList& _studentsNames, int _nTotalStudents, int _nSplits, int _totalDuration, int _durations[], int _parities[], bool _active[]); /** Adds a new equipment (already allocated). Returns true on success, false for already existing equipments (same name). */ bool addEquipment(Equipment* eq); /** Returns -1 if not found or the index in the equipments list if found. */ int searchEquipment(const QString& equipmentName); /** Removes the equipment with this name. Returns true on success, false on failure (not found). */ bool removeEquipment(const QString& equipmentName); /** Modifies (renames) this equipment and takes care of all related constraints. Returns true on success, false on failure (if not found) */ bool modifyEquipment(const QString& initialEquipmentName, const QString& finalEquipmentName); /** A function to sort the equipments alphabetically */ void sortEquipmentsAlphabetically(); /** Adds a new building (already allocated). Returns true on success, false for already existing building (same name). */ bool addBuilding(Building* eq); /** Returns -1 if not found or the index in the buildings list if found. */ int searchBuilding(const QString& buildingName); /** Removes the building with this name. Returns true on success, false on failure (not found). */ bool removeBuilding(const QString& buildingName); /** Modifies (renames) this building and takes care of all related constraints. Returns true on success, false on failure (if not found) */ bool modifyBuilding(const QString& initialBuildingName, const QString& finalBuildingName); /** A function to sort the buildings alphabetically */ void sortBuildingsAlphabetically(); /** Adds a new room (already allocated). Returns true on success, false for already existing rooms (same name). */ bool addRoom(Room* rm); /** Returns -1 if not found or the index in the rooms list if found. */ int searchRoom(const QString& roomName); /** Removes the room with this name. Returns true on success, false on failure (not found). */ bool removeRoom(const QString& roomName); /** Modifies this room and takes care of all related constraints. Returns true on success, false on failure (if not found) It does not alter the list of equipments. */ bool modifyRoom(const QString& initialRoomName, const QString& finalRoomName, const QString& type, const QString& building, int capacity); /** A function to sort the room alphabetically, by name */ void sortRoomsAlphabetically(); /** Adds a new time constraint (already allocated). Returns true on success, false for already existing constraints. */ bool addTimeConstraint(TimeConstraint* ctr); /** Removes this time constraint. Returns true on success, false on failure (not found). */ bool removeTimeConstraint(TimeConstraint* ctr); /** Adds a new space constraint (already allocated). Returns true on success, false for already existing constraints. */ bool addSpaceConstraint(SpaceConstraint* ctr); /** Removes this space constraint. Returns true on success, false on failure (not found). */ bool removeSpaceConstraint(SpaceConstraint* ctr); /** Reads the rules from the xml input file "filename". Returns true on success, false on failure (inexistent file or wrong format) */ bool read(const QString& filename); /** Write the rules to the xml input file "inputfile". */ void write(const QString& filename); int activateTeacher(const QString& teacherName); int activateStudents(const QString& studentsName); int activateSubject(const QString& subjectName); int activateSubjectTag(const QString& subjectTagName); int deactivateTeacher(const QString& teacherName); int deactivateStudents(const QString& studentsName); int deactivateSubject(const QString& subjectName); int deactivateSubjectTag(const QString& subjectTagName);};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -