-
Notifications
You must be signed in to change notification settings - Fork 2
/
benchmark_drawer.py
151 lines (127 loc) · 5.21 KB
/
benchmark_drawer.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
from pathlib import Path
from src.benchmarks.graph import plot_data, GraphSettings, GraphSetting
from src.benchmarks.parser import parse_set, Field
data_path = Path("data")
def parse_ilp_ssp():
ilp_profile_path = data_path / "ilp_ssp_profile"
parsed_results = parse_set(ilp_profile_path)
graph_settings = GraphSettings([
GraphSetting(x_field=Field.MAP_NODES,
y_field=Field.PERCENTAGE_SOLVED,
line_field=Field.SOLVER,
title=None,
x_text="Number of map vertices",
y_text="Solved (%)",
scatter=False),
GraphSetting(x_field=Field.NODES,
y_field=Field.RUNTIME,
line_field=Field.SOLVER,
title=None,
x_text="Number of created NF nodes",
y_text="Runtime (s)",
scatter=True),
],
sync_x=False)
plot_data(parsed_results, graph_settings, data_path / "ilp_ssp_graph.pdf")
def parse_teg():
teg_path = data_path / "teg"
parsed_results = parse_set(teg_path)
graph_settings = GraphSettings([
GraphSetting(x_field=Field.AGENTS,
y_field=Field.PERCENTAGE_SOLVED,
line_field=Field.SOLVER,
title=None,
x_text="Number of agents",
y_text="Solved (%)",
scatter=False),
GraphSetting(x_field=Field.AGENTS,
y_field=Field.RUNTIME,
line_field=Field.SOLVER,
title=None,
x_text="Number of agents",
y_text="Runtime (s)",
scatter=False),
GraphSetting(x_field=Field.NODES,
y_field=Field.RUNTIME,
line_field=Field.SOLVER,
title=None,
x_text="Number of created NF nodes",
y_text="Runtime (s)",
scatter=True,
x_scale="log"),
],
sync_x=False)
plot_data(parsed_results, graph_settings, data_path / "teg_graph.pdf")
def parse_comparison():
for comparison in [
"comparison_25percent_1teams", "comparison_25percent_3teams",
"comparison_75percent_1teams", "comparison_75percent_3teams"
]:
comparison_path = data_path / comparison
parsed_results = parse_set(comparison_path)
graph_settings = GraphSettings([
GraphSetting(x_field=Field.AGENTS,
y_field=Field.PERCENTAGE_SOLVED,
line_field=Field.SOLVER,
title=None,
x_text=None,
y_text="Percentage solved (%)"),
GraphSetting(x_field=Field.AGENTS,
y_field=Field.RUNTIME,
line_field=Field.SOLVER,
title=None,
x_text=None,
y_text="Runtime (s)",
plot_confidence_interval=True),
],
sync_x=True)
plot_data(parsed_results, graph_settings,
data_path / f"{comparison}_graph.pdf")
def parse_max_agents():
max_agent_path = data_path / "max_agents"
parsed_results = parse_set(max_agent_path)
graph_settings = GraphSettings([
GraphSetting(x_field=Field.AGENTS,
y_field=Field.PERCENTAGE_SOLVED,
line_field=None,
title=None,
x_text=None,
y_text="Percentage solved (%)"),
GraphSetting(x_field=Field.AGENTS,
y_field=Field.RUNTIME,
line_field=None,
title=None,
x_text="Number of agents",
y_text="Runtime (s)",
plot_confidence_interval=True),
],
sync_x=True)
plot_data(parsed_results, graph_settings,
data_path / f"max_agents_graph.pdf")
def parse_increasing_map_size():
increasing_map_size = data_path / "increasing_map_size"
parsed_results = parse_set(increasing_map_size)
graph_settings = GraphSettings([
GraphSetting(x_field=Field.MAP_NODES,
y_field=Field.PERCENTAGE_SOLVED,
line_field=None,
title=None,
x_text=None,
y_text="Percentage solved (%)"),
GraphSetting(x_field=Field.MAP_NODES,
y_field=Field.RUNTIME,
line_field=None,
title=None,
x_text="Number of map vertices",
y_text="Runtime (s)",
plot_confidence_interval=True),
],
sync_x=True)
plot_data(parsed_results, graph_settings,
data_path / f"increasing_map_graph.pdf")
if __name__ == "__main__":
parse_ilp_ssp()
parse_teg()
parse_comparison()
parse_max_agents()
parse_increasing_map_size()