-
Notifications
You must be signed in to change notification settings - Fork 0
/
test9.py
98 lines (94 loc) · 2.68 KB
/
test9.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
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
from __future__ import print_function
from model_generator import Final_Model_Generator
# Init with complexity_limit, uncertainty_limit
a = Final_Model_Generator(40, 0.1)
# ROW 1
print('row 1:')
print(380)
check = a.has_process(380)
print('already_in: {}'.format(check))
a.add_process(380, 1, 4)
a.set_process_unc_and_comp(380, 0.5, 1, 1)
success = a.create_new_matrix_and_calculate()
print('success: {}'.format(success))
a.finalize()
print(a.cur_model.matrix)
print(a.cur_model.basis)
print(a.cur_model.impact)
# ROW 2
print('row 2:')
print(380)
check = a.has_process(380)
print('already_in: {}'.format(check))
print(248)
check = a.has_process(248)
print('already_in: {}'.format(check))
a.add_process(248, 2, 2)
a.set_process_unc_and_comp(248, 0.25, 0.5, 2)
print(22)
check = a.has_process(22)
print('already_in: {}'.format(check))
a.add_process(22, 0.5, 2)
a.set_process_unc_and_comp(22, 1, 2, 1)
print('248 -> 380')
check = a.has_process_input(380, 248)
print('already_in: {}'.format(check))
a.add_process_input(380, 248, 1)
print('22 -> 248')
check = a.has_process_input(248, 22)
print('already_in: {}'.format(check))
a.add_process_input(248, 22, 2)
success = a.create_new_matrix_and_calculate()
print('success: {}'.format(success)) # Ignore the fact this fails
a.finalize()
print(a.cur_model.matrix)
print(a.cur_model.basis)
print(a.cur_model.impact)
# ROW 3
print('row 3:')
print(380)
check = a.has_process(380)
print('already_in: {}'.format(check))
print(290)
check = a.has_process(290)
print('already_in: {}'.format(check))
a.add_process(290, 2, 3)
a.set_process_unc_and_comp(290, 1, 1, 1)
print(248)
check = a.has_process(248)
print('already_in: {}'.format(check))
print(22)
check = a.has_process(22)
print('already_in: {}'.format(check))
print(22)
check = a.has_process(22)
print('already_in: {}'.format(check))
print(4)
check = a.has_process(4)
print('already_in: {}'.format(check))
a.add_process(4, 0.25, 1)
a.set_process_unc_and_comp(4, 0.5, 0.5, 2)
print('290 -> 380')
check = a.has_process_input(380, 290)
print('already_in: {}'.format(check))
a.add_process_input(380, 290, 0.5)
print('248 -> 290')
check = a.has_process_input(290, 248)
print('already_in: {}'.format(check))
a.add_process_input(290, 248, 0.2)
print('22 -> 248')
check = a.has_process_input(248, 22)
print('already_in: {}'.format(check))
print('22 -> 22')
check = a.has_process_input(22, 22)
print('already_in: {}'.format(check))
print('4 -> 22')
check = a.has_process_input(22, 4)
print('already_in: {}'.format(check))
a.add_process_input(22, 4, 1.5)
success = a.create_new_matrix_and_calculate()
print('success: {}'.format(success)) # Ignore the fact this fails
a.finalize()
print(a.cur_model.matrix)
print(a.cur_model.basis)
print(a.cur_model.impact)