-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
32 lines (24 loc) · 1.19 KB
/
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 salbpone import SolverSALBP, LatexConverter, save_procedure_graph
from problems import task1, task2, task3, task4
current_task: dict = task4
# Масив з тривалістю операцій
t = current_task['t']
# Словник з залежностями операцій
procedure_graph = current_task['procedure_graph']
# Час циклу Т
cycle_time = current_task['T']
# Вирішення задачі
s = SolverSALBP(operations_costs=t,
cycle_time=cycle_time,
precedence_graph=procedure_graph,
verbose=True)
# Адаптація обмежень у формат Latex
print('\nДрук адаптованих LaTex формул:')
LatexConverter(constraints=s.constraints).print_latex()
LatexConverter(constraints=[s.objective_function]).print_latex()
# Збереження візуалізації графу операцій
print('\nЗбереження інтерактивного графу HTML...')
save_procedure_graph(procedure_graph=procedure_graph,
t=t,
file_name=current_task['title']+'.html')
print('\nРобота програми завершена.')