Repository navigation
Expand file tree
/
Copy pathMain.py
More file actions
111 lines (84 loc) · 2.66 KB
/
Copy pathMain.py
File metadata and controls
111 lines (84 loc) · 2.66 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
102
103
104
105
106
107
108
109
110
111
"""
The entire timetable generating process comes here
# Representation
First Data structures had to be defined to represent our data and manipulate it
## External Data
Found in Objects
- Academic
- Courses
- Units
- Persons
- Instructors
- Groups of students
- Physical
- Rooms
- User
- Preferences
- Priorities
## Internal Components
These are components to be used by the program, found inside Logic
- Statistics
- Calculators
- Costs
- Structure
- Schedule
- Session
- Timetable
- FreePeriods
- Group
- Instructor
- Room
- Datetime
- Day
- Daytime
- Duration
- Time
- Week
## Models
These are functions usefull in the entire generation process
- Evaluation
- Generator
- Optimization
- Annealing
# Parsing
"""
from Assets.FileHandling.Read import Read
from Assets.FileHandling.Write import Write
from Assets.Functions.Echo import Echo
from Data.Parsers.Data import DataReader
from Data.Validators.Type import FileTypeValidator
from Logic.DateTime.Day import Day
from Logic.DateTime.DayTime import DayTime
from Logic.DateTime.Time import Time
from Models.Evaluation.Fitness import FitnessEvaluation
from Models.Generator.Generator import Generator
from Models.Loop.Loop import Loop
from Models.Optimization.Constraint import ConstaraintSatisfaction
from Models.Optimization.Genetic import Genetic
Echo.state = True
data = Read("Data/Defaults/data.json").extract()
reader = DataReader(data)
reader.Encode()
genetic = Genetic(reader)
genetic.Intialise()
# generator = Generator(reader.configuration, reader.instructors, reader.rooms, reader.units, reader.programmes, reader.groups)
# raw_timetable = generator.Process()
# timeteable_generator = Generator(reader.configuration, reader.instructors, reader.rooms, reader.units, reader.programmes, reader.groups)
# initial_timetable = timeteable_generator.Process()
# evaluate = FitnessEvaluation(initial_timetable, reader.rooms, reader.groups, reader.instructors, reader.configuration.priorities)
# evaluate.Evaluate()
# evaluate.Redefine()
# def testing(timetable):
# evaluated = FitnessEvaluation(timetable, reader.rooms, reader.groups, reader.instructors, reader.configuration.priorities)
# evaluated.Evaluate()
# evaluated.Redefine()
# timetable = evaluated.Output()
# cs = ConstaraintSatisfaction(timetable)
# cs.Optimize()
# timetable = cs.Output()
# timetable = evaluate.Output()
# # # timetable = evaluated.Output()
# loop = Loop(testing, 100, timetable)
# loop.Loop()
# # loop = Loop(raw_timetable, reader.rooms, reader.groups, reader.instructors, reader.configuration.priorities)
# # loop.Loop(max_limit=5, saturation=False)