-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
32 lines (22 loc) · 879 Bytes
/
main.py
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
from Assets.FileHandling.Read import Read
from Assets.FileHandling.Write import Write
from Assets.Functions.Echo import Echo
from Data.Parser.Reader import DataReader
from Logic.Structure.Timetable import PrintTimetable, Timetable
from Models.ConstraintSatisfaction.ConstraintSolver import ConstraintSolver
from Models.Evaluation.Fitness import FitnessEvaluation
from Models.General.Definition import Definition
Echo.state = True
f = Read("Data/Inputs/mini.json").Extract()
dr = DataReader(f)
dr.Encode()
d= dr.Output()
definition = Definition(d)
statics, dynamics = definition.Output()
c = ConstraintSolver(statics, dynamics, search_rearangement_method = True, search_rearangement_criteria = "least")
c.NodeConsistency()
c.Backtrack()
t = Timetable(c.assignment.Output())
FitnessEvaluation(t, d)
PrintTimetable(t, d).Print()
Write("", "final.json", t.Output()).dump()