-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconst.py
110 lines (95 loc) · 2.13 KB
/
const.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
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/python3
# EXECUTIONS VALUES
# ADVICE FOR TESTING:
# - leave EXECUTION = 10
# - SERVICES_NUM = [10]
# - SDS_NUM = [10]
# - CHS_NUM = [1]
# not meaningful but fast to check results format
EXECUTION = 5
SERVICES_NUM = [10, 25, 50, 100]
SDS_NUM = [10, 25, 50, 100]
# VALUES
# service data values
SD_VALUE = {
'BAD': 0,
'AVG': 1,
'GOOD': 2
}
REQ_CARDINALITY_EXISTS = 0
REQ_CARDINALITY_FORALL = 1
# cardinalities values
REQ_CARDINALITY = {
'EXISTS': REQ_CARDINALITY_EXISTS,
'FORALL': REQ_CARDINALITY_FORALL
}
# policies values
POLICIES = {
'LOOSE': [0.3, 0.6],
'STRICT': [0.6, 0.9]
}
# change worsening
CHANGE = {
'WORSENING': 0,
'IMPROVING': 1
}
# PROBABILITIES
# service data probabilities
SD_PROBABILITIES = [
[1/3, 1/3, 1/3],
[0.5, 0.25, 0.25],
[0.25, 0.5, 0.25],
[0.25, 0.25, 0.5],
]
# policies and requirements probabilities
REQUIREMENT_PROBABILITIES = [
{
'POLICY': [0.5, 0.5],
'REQUIREMENTS': [1/3, 1/3, 1/3],
'CARDINALITY': [0.5, 0.5]
},
{
'POLICY': [2/3, 1 - 2/3],
'REQUIREMENTS': [2/3, (1/3) / 2, (1/3) / 2],
'CARDINALITY': [2/3, 1/3]
},
{
'POLICY': [2/3, 1 - 2/3],
'REQUIREMENTS': [(1/3) / 2, 2/3, (1/3) / 2],
'CARDINALITY': [2/3, 1/3]
}
]
# changes
CHANGES_PROBABILITIES = [
{
'SERVICE': [0.25, 1 - 0.25],
'DATA': [0.25, 1 - 0.25]
},
{
'SERVICE': [0.25, 1 - 0.25],
'DATA': [0.75, 1 - 0.75]
},
{
'SERVICE': [0.75, 1 - 0.75],
'DATA': [0.25, 1 - 0.25]
}
]
# SETTINGS
def getSettings():
SETTINGS = []
sd_i = 0
for sd_p in SD_PROBABILITIES:
req_i = 0
for req_p in REQUIREMENT_PROBABILITIES:
ch_i = 0
for ch_p in CHANGES_PROBABILITIES:
SETTINGS.append({
'SETTING_NAME': f'G{sd_i + 1}.{req_i + 1}.{ch_i + 1}',
'SD_P': sd_p,
'REQS_P': req_p,
'CH_P': ch_p
})
ch_i += 1
req_i += 1
sd_i += 1
return SETTINGS