-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbenchplot.py
More file actions
41 lines (29 loc) · 905 Bytes
/
benchplot.py
File metadata and controls
41 lines (29 loc) · 905 Bytes
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
import argparse
import matplotlib.pyplot as plt
import numpy as np
def get_data(filename):
return np.genfromtxt(filename,
delimiter=',',
skip_header=1,
dtype="i8,i8,f8,i8,i8,f8,i8,i8,f8,i8,i8,f8")
def plot(data):
plt.figure()
plt.title("Benchmark")
plt.xlabel('Optimal distance to goal')
plt.ylabel('Nodes expanded')
# Dijkstra
plt.scatter(data['f0'], data['f1'],
label="Dijkstra", marker='x')
# A*
plt.scatter(data['f0'], data['f4'],
label="A*", marker='x')
plt.legend()
plt.show()
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-f', type=str, help="Filename with the benchmark data", required=True)
args = parser.parse_args()
data = get_data(args.f)
plot(data)
if __name__ == "__main__":
main()