FET - How to add new types of constraints
-----------------------------------------
TIME CONSTRAINTS:
-----------------
To implement new constraints (into the sources of FET), you will have to think
at these aspects:
- First of all, all the constraints are derived from the class TimeConstraint,
which has some pure virtual functions which you must inherit and implement.
This means that I could have added a kind of plug-ins, but for the moment
I preferred the easier solution.
- There are constraints refering to teachers. You can use the table "teachersMatrix"
for this purpose. This is an array a[MAX_TEACHERS][MAX_DAYS_PER_WEEK][MAX_HOURS_PER_DAY].
It is already calculated when you enter the constraint, so do not bother to
think how to compute it. Each location in this array has a value. If it is 0,
then you have no activity at that time. If it is 1, then you have a biweekly activity
scheduled. If it is 2, you have a weekly activity scheduled then. If it is greater
than 2, then you have more than 2 activities (so, a basic compulsory constraints conflict)
(for instance, 3 means one weekly activity and a biweekly one or 3 biweekly activities).
Now, you can manipulate information in this matrix to return an integer value, which is
the number of conflicts. The best way is to provide an evolutionary path for your
objective (for instance, if you want a teacher to have 4 weekly activities on Monday,
the best way would be to return the modulus of 8 (4*2) minus the sum of the column
for Monday.
- There are constraints referring to students. Please treat them identically with
those referring to teachers.
- There are constraints referring to subjects - TODO
- You have here the ConstraintSubjectRequiresRoom - please see that as an example.
- There are constraints referring to the activities. You can work on the matrices
teachersMatrix and studentsMatrix or you can use directly the array times of the
candidate solution (chromosome). This array is named times[MAX_ACTIVITIES] and each
location contains the starting time of the corresponding activity (times[i] contains
the starting time of activity i, which is the i-th activity in the list of
activities). Starting time means nDaysPerWeek*hour+day, so you can obtain
the hour and day by a divide and modulo operation. Having the starting time
of each activity, it is easy to write a procedure to handle any kind of constraint.
You are advised to respect the same principle of evolution, that is, as the candidate
solution is getting closer to a global solution, the conflicts factor must decrease
(gradually).
- The places you will have to look over and modify are:
engine:
- timeconstraint.h and timeconstraint.cpp
- rules.cpp, function "read"
- rules.cpp - when erasing activities, teachers, students or rooms referring to your
constraint, you must take care to erase also your constraint or a part of it.
- rules.cpp - when renaming teachers etc.
- there are some special kinds of constraints, which hopefully you can avoid.
For instance, compulsory ConstraintActivitiesSameTime and ConstraintActivityPreferredTime
work by repairing.
interface:
- you will have to modify fetmainform_template.ui, fetmainform.h and fetmainform.cpp
and add some new files, named correspondigly (e-mail me if uncertain).
- you will have to modify alltimeconstraintsform.cpp.
SPACE CONSTRAINTS:
------------------
TODO
没有合适的资源?快使用搜索试试~ 我知道了~
C++ 排课程序源代码
共703个文件
h:222个
cpp:222个
ui:201个
4星 · 超过85%的资源 需积分: 32 194 下载量 132 浏览量
2011-11-05
13:43:54
上传
评论 12
收藏 1.32MB RAR 举报
温馨提示
C++ 排课程序源代码,包含两个排课程序: Course_Arrangement用C++写的自动排课程序 遗传算法做排课软件源码 其中第二个源码也就是遗传算法做排课软件做的比较详细,源代码较丰富,也是比较早的C++程序,全部看完看懂需要点耐心。
资源推荐
资源详情
资源评论
收起资源包目录
C++ 排课程序源代码 (703个子文件)
fet.1 1KB
AUTHORS 405B
ChangeLog 29KB
COPYING 18KB
rules.cpp 193KB
timeconstraint.cpp 168KB
spaceconstraint.cpp 121KB
timetableallocatehoursroomsform.cpp 51KB
fetmainform.cpp 46KB
timetableallocateroomsform.cpp 39KB
timetableallocatehoursform.cpp 36KB
timespacechromosome.cpp 18KB
addactivityform.cpp 15KB
timechromosome.cpp 13KB
timetableviewstudentswithrooms2form.cpp 13KB
timetableviewstudentswithroomsform.cpp 12KB
fet.cpp 12KB
modifyactivityform.cpp 11KB
alltimeconstraintsform.cpp 11KB
activity.cpp 11KB
timetableviewteacherswithroomsform.cpp 11KB
timetableviewteacherswithrooms2form.cpp 11KB
addconstraintactivitiessamestartingtimeform.cpp 10KB
timespacepopulation.cpp 10KB
timepopulation.cpp 10KB
spacepopulation.cpp 10KB
allspaceconstraintsform.cpp 10KB
timetableviewrooms2form.cpp 9KB
timetableviewstudentsform.cpp 9KB
timetableviewroomsform.cpp 9KB
spacechromosome.cpp 9KB
subgroupsform.cpp 8KB
timetableviewteachersform.cpp 8KB
modifyconstraintactivitiespreferredtimesform.cpp 8KB
Course_Arrangement.cpp 7KB
studentsset.cpp 7KB
activitiesform.cpp 6KB
addconstraintactivitiespreferredtimesform.cpp 6KB
modifyconstraintstudentssetnotavailableform.cpp 6KB
modifyconstraintstudentssetintervalmaxdaysperweekform.cpp 6KB
groupsform.cpp 6KB
addconstraintstudentssetnotavailableform.cpp 5KB
modifyconstraintteachernotavailableform.cpp 5KB
addconstraintstudentssetintervalmaxdaysperweekform.cpp 5KB
subjecttagsform.cpp 5KB
modifyconstraintactivitypreferredtimeform.cpp 5KB
addconstraintteachernotavailableform.cpp 5KB
constraintsubjectsubjecttagpreferredroomform.cpp 5KB
modifyconstraintsubjectsubjecttagrequireequipmentsform.cpp 5KB
modifyconstraintactivitypreferredtimesform.cpp 5KB
subjectsform.cpp 5KB
modifyconstraintsubjectsubjecttagpreferredroomsform.cpp 5KB
constraintsubjectsubjecttagpreferredroomsform.cpp 5KB
teachersform.cpp 5KB
constraintsubjectsubjecttagrequireequipmentsform.cpp 5KB
addconstraintactivitypreferredtimeform.cpp 5KB
constraintteachersubjectrequireroomform.cpp 5KB
constraintstudentssetintervalmaxdaysperweekform.cpp 5KB
modifyconstraintminndaysbetweenactivitiesform.cpp 5KB
modifyconstraintactivitiesnotoverlappingform.cpp 5KB
constraintteacherssubjecttagmaxhourscontinuouslyform.cpp 5KB
modifyconstraintactivitiessamestartingtimeform.cpp 5KB
modifyconstraintactivitiessamestartinghourform.cpp 5KB
addconstraintsubjectsubjecttagpreferredroomsform.cpp 5KB
addconstraintsubjectsubjecttagrequireequipmentsform.cpp 5KB
constraintstudentssetnotavailableform.cpp 5KB
constraintstudentssetnhoursdailyform.cpp 5KB
modifyconstraintactivitiessameroomform.cpp 5KB
addconstraintminndaysbetweenactivitiesform.cpp 5KB
addconstraintactivitiesnotoverlappingform.cpp 5KB
modifyconstraintstudentssetnhoursdailyform.cpp 5KB
modifyconstraintbreakform.cpp 5KB
constraintsubjectpreferredroomform.cpp 5KB
constraintteacherrequiresroomform.cpp 4KB
addconstraintactivitiessamestartinghourform.cpp 4KB
constraintstudentssetnogapsform.cpp 4KB
addconstraintstudentssetnhoursdailyform.cpp 4KB
addconstraintactivitypreferredtimesform.cpp 4KB
addconstraintactivitiessameroomform.cpp 4KB
constraintsubjectpreferredroomsform.cpp 4KB
constraintsubjectrequiresequipmentsform.cpp 4KB
constraintteacherssubjecttagsmaxhourscontinuouslyform.cpp 4KB
modifyconstraintactivitypreferredroomsform.cpp 4KB
addconstraintbreakform.cpp 4KB
modifyconstraintsubjectpreferredroomsform.cpp 4KB
roomsform.cpp 4KB
constraintteachermaxdaysperweekform.cpp 4KB
constraintminimizebuildingchangesforstudentsform.cpp 4KB
modifyconstraintroomtypenotallowedsubjectsform.cpp 4KB
constraintminimizebuildingchangesforteachersform.cpp 4KB
constraintactivitypreferredroomform.cpp 4KB
constraintteachernotavailableform.cpp 4KB
constraintminimizenumberofroomsforstudentsform.cpp 4KB
addconstraintactivitypreferredroomsform.cpp 4KB
modifyconstraintsubjectrequiresequipmentsform.cpp 4KB
constraintteacherssubgroupsmaxhoursdailyform.cpp 4KB
constraintroomnotavailableform.cpp 4KB
constraint2activitiesconsecutiveform.cpp 4KB
constraintteachersmaxhourscontinuouslyform.cpp 4KB
addconstraintsubjectpreferredroomsform.cpp 4KB
共 703 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
勾之月
- 粉丝: 692
- 资源: 6714
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (源码)基于Spark的实时用户行为分析系统.zip
- (源码)基于Spring Boot和Vue的个人博客后台管理系统.zip
- 将流行的 ruby faker gem 引入 Java.zip
- (源码)基于C#和ArcGIS Engine的房屋管理系统.zip
- (源码)基于C语言的Haribote操作系统项目.zip
- (源码)基于Spring Boot框架的秒杀系统.zip
- (源码)基于Qt框架的待办事项管理系统.zip
- 将 Java 8 的 lambda 表达式反向移植到 Java 7、6 和 5.zip
- (源码)基于JavaWeb的学生管理系统.zip
- (源码)基于C++和Google Test框架的数独游戏生成与求解系统.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
前往页