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语言-遗传算法的排课源码
共700个文件
h:221个
cpp:221个
ui:201个
4星 · 超过85%的资源 需积分: 50 101 下载量 80 浏览量
2015-09-30
22:51:46
上传
评论 4
收藏 527KB 7Z 举报
温馨提示
C语言-遗传算法的排课源码,遗传算法、使用c语言开发,源码
资源推荐
资源详情
资源评论
收起资源包目录
C语言-遗传算法的排课源码 (700个子文件)
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
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
constraintmaxbuildingchangesperdayforstudentsform.cpp 4KB
共 700 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
- seisyu2019-03-25下载中心自治州
llaitt
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- NetOps-py通过sftp替换网络设备启动文件
- STM32单片机FPGA毕设电路原理论文报告任务驱动教学法在单片机课程教学中的应用
- STM32单片机FPGA毕设电路原理论文报告任务驱动法在单片机教学中的应用
- STM32单片机FPGA毕设电路原理论文报告人造金刚石压机智能化压力测控系统设计
- 以某列为依据匹配多项(Excel版)
- STM32单片机FPGA毕设电路原理论文报告人体短臂离心机实验台的显示控制系统
- STM32单片机FPGA毕设电路原理论文报告人工气候室监控系统的环境控制器研究
- STM32单片机FPGA毕设电路原理论文报告染整自动线张力控制系统的设计
- 数据挖掘与机器学习-实验
- 基于Linux系统Nginx的动态网站的LNMP环境源码包
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功