-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplotResults.py
105 lines (78 loc) · 2.38 KB
/
plotResults.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
#!/usr/bin/env python
#import numpy as np
import os
from numpy import *
import numpy.numarray as na
import matplotlib.pyplot as plt
# scan all maps
maps = filter(os.path.isdir, os.listdir('.'))
xlabels = []
means = zeros(0)
stds = zeros(0)
if '.svn' in maps:
maps.remove('.svn')
first = True
for currMap in maps:
xlabels.append(currMap)
dataFFD = genfromtxt(currMap + "/executions/partial_ffd_executions.txt")
dataWFD = genfromtxt(currMap + "/executions/exploration_execution_rafael.txt")
dataWolfram = genfromtxt(currMap + "/executions/exploration_execution_wolfram.txt")
dataFFD = dataFFD[:,1]
# check IF NEEDED CLIPPING!!!!!1
# WFD works on a world smaller by 8X8 so factor it to 64
dataWFD = 64*dataWFD
print type(dataFFD)
print dataFFD.shape
print currMap
print dataFFD.mean(), dataWFD.mean(), dataWolfram.mean()
currMeans = concatenate(([],[dataFFD.mean(), dataWFD.mean(), dataWolfram.mean()]),0)
currStds = concatenate(([],[dataFFD.std(), dataWFD.std(), dataWolfram.std()]))
if first:
means = currMeans
stds = currStds
first = False
else:
means = vstack((means, currMeans))
stds = vstack((stds, currStds))
#means = concatenate((means, currMeans),0)
#stds = concatenate((stds, currStds),0)
ind = arange(len(means))
width = 0.25
fig = plt.figure()
ax = fig.add_subplot(111)
#plt.yscale('log')
offset = 0
rectList = []
colors = ['#fafad2', 'Cyan', 'Red']
for i in range(len(means[0])):
rectList.append(ax.bar(ind+width*i , means[:,i], width, color=colors[i], yerr=stds[:,i], log=True))
#offset += width
#for i in range(cols):
# currBars = means[:,i]
# add some labels
ax.set_ylabel('logscale time (microseconds)')
ax.set_xticks(ind+width*1.5)
ax.set_xlabel('environments')
ax.set_xticklabels( ('(A)', '(B)', '(C)', '(D)', '(E)', '(F)'), fontsize=13 )
ax.grid(b=True,which='major')
def getFirst(x):
return x[0]
ax.legend(map(getFirst, rectList), ('FFD', 'WFD', 'SOTA'))
plt.ylim(10**3,10 ** 9)
#plt.show()
plt.savefig('plot_Results.png')
plt.savefig('plot_Results.eps')
if 1==2:
# plot mean graph
xlocations = na.array(range(len(means)))+0.5
plt.bar(xlocations, means, color='Cyan')
plt.xlabel("particles")
plt.ylabel("average run-time (microseconds)")
plt.grid(b=True,which='major')
plt.hold(True)
# plot error bars
plt.errorbar(range(1,len(means)+1),means,stds)
import matplotlib.pyplot as p
p.xlim(0,len(means)+1)
#plt.show()
p.savefig("matan.png")