-
Notifications
You must be signed in to change notification settings - Fork 0
/
parsing.py
97 lines (73 loc) · 2.43 KB
/
parsing.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
import importlib
def get_locations(algorithm, package):
locations = []
alg = importlib.import_module('.' + algorithm, package = package)
if alg.local:
locations = alg.local
return locations
def get_init_locations(algorithm, package):
init_locations = []
alg = importlib.import_module('.' + algorithm, package = package)
if alg.initial:
init_locations = alg.initial
return init_locations
def get_rules(algorithm, package):
rules = []
alg = importlib.import_module('.' + algorithm, package = package)
if alg.rules:
rules = alg.rules
return rules
def get_snd_counters(algorithm, package):
snd_counters = {}
alg = importlib.import_module('.' + algorithm, package = package)
if alg.L:
snd_counters = alg.L.keys()
return snd_counters
def get_L(algorithm, package):
L = {}
alg = importlib.import_module('.' + algorithm, package = package)
if alg.L:
L = alg.L
return L
def get_rcv_counters(algorithm, package):
rcv_counters = []
alg = importlib.import_module('.' + algorithm, package = package)
if alg.rcv_vars:
rcv_counters = alg.rcv_vars
return rcv_counters
def get_parameters(algorithm, package):
parameters = []
alg = importlib.import_module('.' + algorithm, package = package)
if alg.params:
parameters = alg.params
return parameters
def get_resilience_condition(algorithm, package):
res_cond = []
alg = importlib.import_module('.' + algorithm, package = package)
if alg.rc:
res_cond = alg.rc
return res_cond
def get_phase(algorithm, package):
phase = 1
alg = importlib.import_module('.' + algorithm, package = package)
if alg.phase:
phase = alg.phase
return phase
def get_environment(algorithm, package):
environment = []
alg = importlib.import_module('.' + algorithm, package = package)
if alg.environment:
environment = alg.environment
return environment
def get_constraints(algorithm, package):
constraints = []
alg = importlib.import_module('.' + algorithm, package = package)
if alg.constraints:
constraints = alg.constraints
return constraints
def get_properties(algorithm, package):
properties = []
alg = importlib.import_module('.' + algorithm, package = package)
if alg.properties:
properties = alg.properties
return properties