-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrange.h
More file actions
102 lines (77 loc) · 1.88 KB
/
Copy pathArrange.h
File metadata and controls
102 lines (77 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#ifndef __ARRANGE_H__
#define __ARRANGE_H__
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <ctime>
#include <cstdlib>
using namespace std;
//todo:主程序入口记得加srand(time(NULL));
//教室类型:、普通教室、多媒体教室、机房
enum SiteType { NORMAL = 0, MTMD, CPTRM };
//教室容量:小课室(1个班)、中课室(3个班)、大课室(5个班)
enum SiteCpct { SMALL = 0, MEDIUM, LARGE };
//教师位置:正常、前/后一节在N楼有课、前/后一节在研究院有课
//enum TchPosi { NORMAL = 0, NORTH, SOUTH };
class Appointment {
public:
int room;
int course; //不是课程时为-1
int week, day, period;
Appointment();
Appointment(int r, int c, int w, int d, int p);
};
typedef Appointment* TSchedule[20][5][4];
class Teacher {
public:
string tchId;
TSchedule schedule;
Teacher();
Teacher(string id);
void clearSchedule();
};
class Site {
public:
string siteId;
int capacity;
int type;
TSchedule schedule;
Site();
Site(string id, int c, int t);
void clearSchedule();
};
class StuClass {
public:
string classId; //班号
vector<int> attCrs; //计划修的课程
TSchedule schedule; //课程表
StuClass();
StuClass(string id);
bool insertCourse(int crs);
bool insertAble(int crs, int day, int prd);
bool operator < (const StuClass& scl) const;
bool operator > (const StuClass& scl) const;
void clearSchedule();
};
class Course {
private:
public:
string crsId;
string crsName;
bool tchWeek[20]; //上课周次
int weekcnt; //每周课时数
int env; //上课环境(设备需求)
bool inserted;
vector<int> attCls; //上课班级
int tutor; //上课教师
Course();
Course(string id, string name, int w, int e, int t);
};
extern vector <Teacher> teachers; //教师表
extern vector <Site> sites; //教室表
extern vector <Course> courses; //课程计划表
extern vector <StuClass> classes; //班级表
extern vector <Appointment> appms; //最终排课表
bool arranging();
#endif