-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
79 lines (69 loc) · 3.38 KB
/
Main.java
File metadata and controls
79 lines (69 loc) · 3.38 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
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
ArrayList<Subject> subjects = new ArrayList<Subject>();
// Generate ASF schedule
Subject ASF = new Subject("ASF", new Lecture(Day.TUESDAY, 11, 2));
ASF.addExercise(new Exercise(Day.TUESDAY, 7, 2));
ASF.addExercise(new Exercise(Day.TUESDAY, 9, 2));
ASF.addExercise(new Exercise(Day.TUESDAY, 5, 2));
ASF.addExercise(new Exercise(Day.WEDNESDAY, 9, 2));
ASF.addExercise(new Exercise(Day.THURSDAY, 7, 2));
ASF.addExercise(new Exercise(Day.THURSDAY, 3, 2));
ASF.addExercise(new Exercise(Day.THURSDAY, 5, 2));
ASF.addExercise(new Exercise(Day.TUESDAY, 13, 2));
subjects.add(ASF);
// Generate KAJ schedule
Subject KAJ = new Subject("KAJ", new Lecture(Day.MONDAY, 3, 2));
KAJ.addExercise(new Exercise(Day.MONDAY, 5, 2));
KAJ.addExercise(new Exercise(Day.MONDAY, 7, 2));
KAJ.addExercise(new Exercise(Day.MONDAY, 11, 2));
subjects.add(KAJ);
// Generate TAL schedule
Subject TAL = new Subject("TAL", new Lecture(Day.TUESDAY, 2, 3));
TAL.addExercise(new Exercise(Day.THURSDAY, 1, 2));
TAL.addExercise(new Exercise(Day.THURSDAY, 3, 2));
TAL.addExercise(new Exercise(Day.THURSDAY, 5, 2));
subjects.add(TAL);
// Generate KO schedule
Subject KO = new Subject("KO", new Lecture(Day.TUESDAY, 5, 3));
KO.addExercise(new Exercise(Day.THURSDAY, 1, 2));
KO.addExercise(new Exercise(Day.THURSDAY, 3, 2));
KO.addExercise(new Exercise(Day.THURSDAY, 5, 2));
KO.addExercise(new Exercise(Day.THURSDAY, 7, 2));
KO.addExercise(new Exercise(Day.WEDNESDAY, 9, 2));
KO.addExercise(new Exercise(Day.WEDNESDAY, 11, 2));
KO.addExercise(new Exercise(Day.WEDNESDAY, 13, 2));
KO.addExercise(new Exercise(Day.THURSDAY, 11, 2));
KO.addExercise(new Exercise(Day.THURSDAY, 9, 2));
subjects.add(KO);
// Generate OSP schedule
Subject OSP = new Subject("OSP", new Lecture(Day.WEDNESDAY, 9, 2));
OSP.addExercise(new Exercise(Day.THURSDAY, 11, 2));
OSP.addExercise(new Exercise(Day.THURSDAY, 3, 2));
OSP.addExercise(new Exercise(Day.THURSDAY, 5, 2));
OSP.addExercise(new Exercise(Day.THURSDAY, 7, 2));
OSP.addExercise(new Exercise(Day.THURSDAY, 9, 2));
OSP.addExercise(new Exercise(Day.THURSDAY, 13, 2));
subjects.add(OSP);
// Generate PDA schedule
Subject PDA = new Subject("PDA", new Lecture(Day.MONDAY, 11, 2));
PDA.addExercise(new Exercise(Day.MONDAY, 5, 2));
PDA.addExercise(new Exercise(Day.MONDAY, 7, 2));
PDA.addExercise(new Exercise(Day.MONDAY, 9, 2));
subjects.add(PDA);
Solver solver = new Solver(subjects);
Printer printer = new Printer();
try {
solver.allowLectureCoversLimitation();
solver.allowExerciseCoversLecture();
solver.setLatestItem(12);
solver.setEarliestItem(5);
Schedule schedule = solver.solve();
printer.print(schedule, "./schedule.html");
} catch (SmartScheduleException e) {
System.out.println(e.getMessage());
printer.print(e, "./schedule.html");
}
}
}