package com.ziyu.admin.modules.system.service.impl;
import com.ziyu.admin.modules.system.dto.*;
import com.ziyu.admin.modules.system.service.ISubjectChoose;
import com.ziyu.admin.modules.system.service.IWeightCalc;
import lombok.Data;
import java.util.*;
/**
* \* User: ziyu
* \* Date: 2019/8/1
* \* Time: 13:09
* \* Description:
* \
*/
@Data
public class ClassScheduling {
private Map<Integer, GradeInfoDto> gradeInfoMap;//基础信息 //输入信息
private List<SchedulePositionInfo> udfFixedSubjectList; //外部初始化
private Map<Integer, Map<Integer, Map<Integer, Map<Integer, SchedulePositionInfo>>>> scheduleInfos;//课表信息,年级:班级:周天:课节:课程 //最终输出
private Map<String, Map<Integer, Map<Integer, SchedulePositionInfo>>> teacherSchedule;//老师课程安排 //中间数据
private Map<Integer, Map<Integer, List<ScheduleClassInfo>>> scheduleClassInfo;//班级课程信息
private Map<Integer, Map<Integer, Map<Integer, Map<Integer, List<SchedulingProcessInfo>>>>> scheduledInfo;//已经排课位置信息 //中间数据
private Map<Integer, Integer> scheduledLesson;//已经安排的位置
private Map<Integer, Map<Integer, Integer>> classFreeSpace;//班级剩余课节数
private List<String> teacherList;//老师列表
private Integer gradeCount = 0;//多少个年级
private Integer classCount = 0;//多少个班级
private Integer maxDayPerWeek = 0;//做大周天数
private Integer maxLessonPerDay = 0;//最大节数
private Integer maxWeight = 0;
private List<SchedulePositionInfo> onlyOneChoice;
public ISubjectChoose iSubjectChoose;//科目自定义规则筛选
public IWeightCalc iWeightCalc;//科目权重外部因素计算
public Map<Integer, GradeInfoDto> getGradeInfoMap() {
return gradeInfoMap;
}
public void setGradeInfoMap(Map<Integer, GradeInfoDto> gradeInfoMap) {
this.gradeInfoMap = gradeInfoMap;
}
public List<SchedulePositionInfo> getUdfFixedSubjectList() {
return udfFixedSubjectList;
}
public void setUdfFixedSubjectList(List<SchedulePositionInfo> udfFixedSubjectList) {
this.udfFixedSubjectList = udfFixedSubjectList;
}
public Map<Integer, Map<Integer, Map<Integer, Map<Integer, SchedulePositionInfo>>>> getScheduleInfos() {
return scheduleInfos;
}
public void setScheduleInfos(Map<Integer, Map<Integer, Map<Integer, Map<Integer, SchedulePositionInfo>>>> scheduleInfos) {
this.scheduleInfos = scheduleInfos;
}
public Map<String, Map<Integer, Map<Integer, SchedulePositionInfo>>> getTeacherSchedule() {
return teacherSchedule;
}
public void setTeacherSchedule(Map<String, Map<Integer, Map<Integer, SchedulePositionInfo>>> teacherSchedule) {
this.teacherSchedule = teacherSchedule;
}
public Map<Integer, Map<Integer, List<ScheduleClassInfo>>> getScheduleClassInfo() {
return scheduleClassInfo;
}
public void setScheduleClassInfo(Map<Integer, Map<Integer, List<ScheduleClassInfo>>> scheduleClassInfo) {
this.scheduleClassInfo = scheduleClassInfo;
}
public Map<Integer, Map<Integer, Map<Integer, Map<Integer, List<SchedulingProcessInfo>>>>> getScheduledInfo() {
return scheduledInfo;
}
public void setScheduledInfo(Map<Integer, Map<Integer, Map<Integer, Map<Integer, List<SchedulingProcessInfo>>>>> scheduledInfo) {
this.scheduledInfo = scheduledInfo;
}
public Map<Integer, Integer> getScheduledLesson() {
return scheduledLesson;
}
public void setScheduledLesson(Map<Integer, Integer> scheduledLesson) {
this.scheduledLesson = scheduledLesson;
}
public Map<Integer, Map<Integer, Integer>> getClassFreeSpace() {
return classFreeSpace;
}
public void setClassFreeSpace(Map<Integer, Map<Integer, Integer>> classFreeSpace) {
this.classFreeSpace = classFreeSpace;
}
public List<String> getTeacherList() {
return teacherList;
}
public void setTeacherList(List<String> teacherList) {
this.teacherList = teacherList;
}
public Integer getGradeCount() {
return gradeCount;
}
public void setGradeCount(Integer gradeCount) {
this.gradeCount = gradeCount;
}
public Integer getClassCount() {
return classCount;
}
public void setClassCount(Integer classCount) {
this.classCount = classCount;
}
public Integer getMaxDayPerWeek() {
return maxDayPerWeek;
}
public void setMaxDayPerWeek(Integer maxDayPerWeek) {
this.maxDayPerWeek = maxDayPerWeek;
}
public Integer getMaxLessonPerDay() {
return maxLessonPerDay;
}
public void setMaxLessonPerDay(Integer maxLessonPerDay) {
this.maxLessonPerDay = maxLessonPerDay;
}
public Integer getMaxWeight() {
return maxWeight;
}
public void setMaxWeight(Integer maxWeight) {
this.maxWeight = maxWeight;
}
public List<SchedulePositionInfo> getOnlyOneChoice() {
return onlyOneChoice;
}
public void setOnlyOneChoice(List<SchedulePositionInfo> onlyOneChoice) {
this.onlyOneChoice = onlyOneChoice;
}
public ISubjectChoose getiSubjectChoose() {
return iSubjectChoose;
}
public void setiSubjectChoose(ISubjectChoose iSubjectChoose) {
this.iSubjectChoose = iSubjectChoose;
}
public IWeightCalc getiWeightCalc() {
return iWeightCalc;
}
public void setiWeightCalc(IWeightCalc iWeightCalc) {
this.iWeightCalc = iWeightCalc;
}
//开始制作课程表
public boolean makeLessonTable() {
//检查gradeInfo
if (!this.checkInputGradeInfo(this.gradeInfoMap)) {
return false;
}
//检查课程是否可以排满
if (!this.processNullPos(this.gradeInfoMap)) {
return false;
}
//c初始化老师课程安排信息
if (!initTeacherList(this.gradeInfoMap)) {
return false;
}
//初始化老师任课信息
if (!this.initTeacherLesson()) {
return false;
}
//初始化课表信息
if (!this.initLessonTableInfo(this.gradeInfoMap)) {
return false;
}
//初始化中间排课过程信息
if (!this.initScheduldInfo(this.gradeInfoMap)) {
return false;
}
this.scheduledLesson = new HashMap<Integer, Integer>();
this.onlyOneChoice = new ArrayList<SchedulePositionInfo>();
//优先安排外部设定唯一的科目
this.firstSetUdfOnlyOneSubject(this.udfFixedSubjectList);
this.firstSetOnlyChoice();
//遍历所有课节
for (Map.Entry<Integer, GradeInfoDto> item : this.gradeInfoMap.entrySet()) {
for (Map.Entry<Integer, ClassInfo> itemItem : item.getValue().getClassInfos().entrySet()) {
for (Integer weekDay = 0; weekDay < item.getValue().getDayPerWeek(); weekDay++) {
for (Integer lessonNo = 0; lessonNo < item.getValue().getLessonPerDay(); lessonNo++) {
//排课
/*
1、如果已经安排则跳过
2、筛选可排科目
3、处理科目权重
4、安排课程
5、预处理后续课程信息
*/
if (this.scheduledLesson.get(this.generateKey(item.getKey(), itemItem.getKey(), weekDay, lessonNo)) != null) {
continue;//已经排课
}
//获取可选科目列表
List<SchedulingProcessInfo> lessonValidSubjects = this.fetchValidSubject(item.getKey(), itemItem.getKey(), weekDay, lessonNo);
i
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
python 【项目资源】:包含前端、后端、移动开发、人工智能、物联网、信息化管理、数据库、硬件开发、大数据、课程资源,毕业设计等各种技术项目的源码。包括C++、Java、python、web、C#、EDA等项目的源码。 【适用人群】:适用于希望学习不同技术领域的初学者或进阶学习者。可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。 【附加价值】:项目具有较高的学习借鉴价值,也可直接拿来修改复刻。对于有一定基础或热衷于研究的人来说,可以在这些基础代码上进行修改和扩展,实现其他功能。 【沟通交流】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。鼓励下载和使用,并欢迎大家互相学习,共同进步。
资源推荐
资源详情
资源评论
收起资源包目录
基于java的简单的教师-课程智能排课系统 (835个子文件)
ClassScheduling.class 45KB
WetechAdminApplicationTests.class 22KB
LessonScheduleService.class 12KB
UserController.class 11KB
ShiroConfig.class 9KB
GradeInfoDto.class 8KB
GlobalExceptionHandler.class 7KB
OrganizationServiceImpl.class 7KB
HomeController.class 6KB
GradeInfo.class 6KB
UserServiceImpl.class 6KB
SystemLogAspect.class 6KB
RoleServiceImpl.class 5KB
CurriculumInfo.class 5KB
ResourceServiceImpl.class 5KB
UserVO.class 5KB
BaseCrudController.class 5KB
BaseService.class 5KB
ScheduleClassInfo.class 5KB
SchedulePositionInfo.class 4KB
SubjectInfoDto.class 4KB
Result.class 4KB
ResourceDto.class 4KB
SubjectInfo.class 4KB
DateUtil.class 4KB
WebUtil.class 4KB
Resource.class 4KB
OrganizationController.class 4KB
UserRealm.class 4KB
CurriculumInfoServiceImpl.class 4KB
SchedulingProcessInfo.class 4KB
User.class 4KB
WebConfig.class 4KB
SubjectInfoController.class 4KB
GradeInfoController.class 4KB
RoleDto.class 4KB
ResourceController.class 4KB
ZipUtils.class 3KB
RoleController.class 3KB
SpringCacheManagerWrapper$SpringCacheWrapper.class 3KB
Log.class 3KB
JsonUtil.class 3KB
PageQuery.class 3KB
ScheduleInfo.class 3KB
GroupController.class 3KB
CurriculumInfoController.class 3KB
Organization.class 3KB
ResultCodeEnum.class 2KB
ClassInfo.class 2KB
Role.class 2KB
PasswordHelper.class 2KB
Group.class 2KB
GroupType.class 2KB
Swagger2Config.class 2KB
SpringUtils.class 2KB
RetryLimitHashedCredentialsMatcher.class 2KB
EhCacheConfig.class 2KB
TreeDto.class 2KB
SubjectInfoServiceImpl.class 2KB
LogController.class 2KB
PropertiesUtil.class 2KB
ResourceType.class 1KB
UserService.class 1KB
SpringCacheManagerWrapper.class 1KB
GradeInfoServiceImpl.class 1KB
GlobalAnnotationDrivenListener.class 1KB
UserMapper.class 1KB
PageResultSet.class 1KB
LogListener.class 1KB
ZiyuAdminApplication.class 1KB
BizException.class 1KB
AsynchronousSpringEventsConfig.class 1KB
OrganizationService.class 1KB
WeightDefines.class 1KB
IService.class 1020B
ZiyuTest.class 860B
CurriculumInfoMapper.class 857B
GroupServiceImpl.class 853B
LogServiceImpl.class 837B
ResourceService.class 810B
Constants.class 720B
SubjectInfoService.class 664B
CurriculumInfoService.class 661B
ThymeleafConfig.class 660B
SubjectInfoMapper.class 615B
SystemLog.class 546B
BaseController.class 532B
RoleService.class 530B
GradeInfoMapper.class 524B
BaseController.class 520B
OrganizationMapper.class 510B
MyBatisConfig.class 510B
ISubjectChoose.class 489B
GradeInfoService.class 466B
ResourceMapper.class 391B
GroupMapper.class 382B
RoleMapper.class 379B
LogMapper.class 376B
IWeightCalc.class 376B
MyMapper.class 350B
共 835 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
白话Learning
- 粉丝: 4583
- 资源: 2962
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功