-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
84 lines (70 loc) · 2.08 KB
/
main.py
File metadata and controls
84 lines (70 loc) · 2.08 KB
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
# --- imports ---
# region
import getopt
import sys
from llg_filereader import read_files
from llg_graphs import show_graphs
from llg_rendertype import RenderType
from llg_results import RtResult, NrtResult
from llg_test_scores import test_scores
# endregion imports
def main(argv):
consoleOutput = False
disableGraphs = False
try:
opts, args = getopt.getopt(argv, "c", ["console", "no-graph"])
except getopt.error as err:
print(str(err))
sys.exit(2)
for opt, arg in opts:
if opt in ["-c", "--console"]:
consoleOutput = True
if opt in ["-c", "--no-graph"]:
disableGraphs = True
return [consoleOutput, disableGraphs]
consoleOutput = False
disableGraphs = False
if __name__ == "__main__":
args = main(sys.argv[1:])
consoleOutput = args[0]
disableGraphs = args[1]
# read all csv files and extract the logs
logs = read_files('data\\')
nrt_logs = logs.nrt_logs
rt_logs = logs.rt_logs
rt_results = []
nrt_results = []
# categorize logs (RT)
for rt_log in rt_logs:
# check if a correspondent result class exists
existingResult = False
for rt_result in rt_results:
if rt_log.equal_settings(rt_result.logs[0]):
rt_result.logs.append(rt_log)
existingResult = True
pass
if not existingResult:
rt_result = RtResult([rt_log])
rt_results.append(rt_result)
# categorize logs (NRT)
for nrt_log in nrt_logs:
# check if a correspondent result class exists
existingResult = False
for nrt_result in nrt_results:
if nrt_log.equal_settings(nrt_result.logs[0]):
nrt_result.logs.append(nrt_log)
existingResult = True
pass
if not existingResult:
nrt_result = NrtResult([nrt_log])
nrt_results.append(nrt_result)
if consoleOutput:
results = []
for rt_result in rt_results:
results.append(rt_result)
for nrt_result in nrt_results:
results.append(nrt_result)
test_scores(results)
if not disableGraphs:
show_graphs(rt_results)
#show_graphs(nrt_results)