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 195 下载量 188 浏览量
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
勾之月
- 粉丝: 693
- 资源: 6728
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- JSONView-for-Chrome
- 博图V17下基于FB块的交通灯程序
- axure浏览器插件0.7.0
- 一个3D旋转的圣诞树,有以下特点: 1. 树由三个绿色三角形组成 2.顶部有一个闪烁的黄色星星 3.底部有棕色树干 4.树上装饰有不同颜色的圣诞球 5.整棵树会缓慢旋转 6.星星和圣诞球都有闪烁效果
- 最新圣诞节生成头像微信小程序源码
- 分布式作业3:使用uDDS之服务器端
- 多功能可折叠画图板(cero+CAD+说明书)全套技术开发资料100%好用.zip
- 方块小孔检查机(含工程图sw19可编辑+bom)全套技术开发资料100%好用.zip
- Hi3519DV500R001C01SPC011海思3519dv500 SDK开发包
- docker安装应用(非常实用)PDF
- 聚合DNS已更新SSL证书自动申请与部署功能
- sdfgvhgfhfgh
- 基于jsp+servlet的房产销售管理系统的设计与实现.doc
- 基于jsp+servlet的美食交流论坛的设计与实现.doc
- abb plc串口通讯协议comli白皮书
- JQuery前端汇聚loading
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
前往页