This repository has been archived by the owner on Oct 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
graphGenerator.py
215 lines (180 loc) · 13.7 KB
/
graphGenerator.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
#%%
import base64
import matplotlib.pyplot as plt
import numpy as np
import json
from ast import literal_eval
data1encoded = 'eyJkZGFFbmFibGVkIjpmYWxzZSwiZGF0YSI6W3sic3RhcnRUaW1lIjoxNjE5MTM3MjUxMzg1LCJkdXJhdGlvbiI6NjQ1Miwic2NvcmUiOjAsImdyYXZpdHkiOjAuMjUsInBpcGVJbnRlcnZhbCI6MTQwMCwicGlwZWhlaWdodCI6OTAsImNvbGxpc2lvblBvc2l0aW9uIjoxMX0seyJzdGFydFRpbWUiOjE2MTkxMzcyNjMwMDYsImR1cmF0aW9uIjo3NTYwLCJzY29yZSI6MCwiZ3Jhdml0eSI6MC4yNSwicGlwZUludGVydmFsIjoxNDAwLCJwaXBlaGVpZ2h0Ijo5MCwiY29sbGlzaW9uUG9zaXRpb24iOjExfSx7InN0YXJ0VGltZSI6MTYxOTEzNzI3NTI0NywiZHVyYXRpb24iOjEyNzQ4LCJzY29yZSI6NCwiZ3Jhdml0eSI6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xMDczNywic2NvcmUiOjMsImdyYXZpdHkiOjAuMjUsInBpcGVJbnRlcnZhbCI6MTQwMCwicGlwZWhlaWdodCI6OTAsImNvbGxpc2lvblBvc2l0aW9uIjoxMX1dfQ=='
data2bytes = base64.b64decode(data2encoded)
data2 = json.loads(data2bytes.decode('utf8'))
scores1 = []
gravity1 = []
pipeInterval1 = []
pipeHeight1 = []
for data in data1["data"]:
scores1.append(data['score'])
gravity1.append(data['gravity'])
pipeInterval1.append(data['pipeInterval'])
pipeHeight1.append(data['pipeheight'])
scores2 = []
gravity2 = []
pipeInterval2 = []
pipeHeight2 = []
for data in data2["data"]:
scores2.append(data['score'])
gravity2.append(data['gravity'])
pipeInterval2.append(data['pipeInterval'])
pipeHeight2.append(data['pipeheight'])
x = np.arange(1, 24, 1)
fig, ax = plt.subplots() # Create a figure containing a single axes.
ax.plot(x, scores1, label='JOE')
ax.plot(x, scores2, label='DALTON')
plt.xticks(x)
ax.set_xlabel('Playthrough')
ax.set_ylabel('Score')
ax.set_title('Scores over the playthroughs')
ax.legend()
fig2, ax2 = plt.subplots() # Create a figure containing a single axes.
ax2.plot(x, gravity1, label='player1')
ax2.plot(x, gravity2, label='player2')
plt.xticks(x)
ax2.set_xlabel('Playthrough')
ax2.set_ylabel('Gravity')
ax2.set_title('Gravity strength over 10 playthroughs')
ax2.legend()
fig3, ax3 = plt.subplots() # Create a figure containing a single axes.
ax3.plot(x, pipeInterval1, label='player1')
ax3.plot(x, pipeInterval2, label='player2')
plt.xticks(x)
ax3.set_xlabel('Playthrough')
ax3.set_ylabel('Pipe Interval Distance')
ax3.set_title('Pipe interval distance over 10 playthroughs')
ax3.legend()
fig4, ax4 = plt.subplots() # Create a figure containing a single axes.
ax4.plot(x, pipeHeight1, label='player1')
ax4.plot(x, pipeHeight2, label='player2')
plt.xticks(x)
ax4.set_xlabel('Playthrough')
ax4.set_ylabel('Pipe Height')
ax4.set_title('Pipe height over 10 playthroughs')
ax4.legend()
# %%
import csv
import base64
import matplotlib.pyplot as plt
import numpy as np
import json
data = []
with open('notddaEnabledData.csv') as csvfile:
reader = csv.reader(csvfile)
for row in reader:
data.append(row[0])
allData = []
for testerData in data:
dataBytes = base64.b64decode(testerData)
jsonData = json.loads(dataBytes.decode('utf8'))
scores = []
pipeInterval = []
pipeHeight = []
i = 0
for run in jsonData["data"]:
if(i != 0 and run['pipeInterval'] == 1410.5):
break
scores.append(run['score'])
pipeInterval.append(run['pipeInterval'])
pipeHeight.append(run['pipeheight'])
i = i + 1
xvals = np.arange(1, len(scores) + 1, 1)
playerData = {"xvals":xvals, "scores":scores, "pipeInterval":pipeInterval, "pipeHeight":pipeHeight}
allData.append(playerData)
fig, ax = plt.subplots()
ax.set_xlabel('Playthrough')
ax.set_ylabel('Score')
ax.set_title('DDA Enabled Scores')
for i in range(len(allData)):
ax.plot(allData[i]["xvals"], allData[i]["scores"], label='player' + str(i))
ax.legend()
fig, ax = plt.subplots()
ax.set_xlabel('Playthrough')
ax.set_ylabel('pipeInterval')
ax.set_title('Baseline pipeInterval Distances')
for i in range(len(allData)):
ax.plot(allData[i]["xvals"], allData[i]["pipeInterval"], label='player' + str(i))
ax.legend()
fig, ax = plt.subplots()
ax.set_xlabel('Playthrough')
ax.set_ylabel('pipeHeight')
ax.set_title('Baseline pipeHeight Distances')
for i in range(len(allData)):
ax.plot(allData[i]["xvals"], allData[i]["pipeHeight"], label='player' + str(i))
ax.legend()
# %%
import csv
import base64
import matplotlib.pyplot as plt
import numpy as np
import json
dataEnabled = []
with open('ddaEnabledData.csv') as csvfile:
reader = csv.reader(csvfile)
for row in reader:
dataEnabled.append(row[0])
dataNotEnabled = []
with open('notddaEnabledData.csv') as csvfile:
reader = csv.reader(csvfile)
for row in reader:
dataNotEnabled.append(row[0])
allDataEnabled = []
for testerData in dataEnabled:
dataBytes = base64.b64decode(testerData)
jsonData = json.loads(dataBytes.decode('utf8'))
scores = []
pipeInterval = []
pipeHeight = []
i = 0
for run in jsonData["data"]:
if(i != 0 and run['pipeInterval'] == 1410.5):
break
scores.append(run['score'])
pipeInterval.append(run['pipeInterval'])
pipeHeight.append(run['pipeheight'])
i = i + 1
xvals = np.arange(1, len(scores) + 1, 1)
playerData = {"xvals":xvals, "scores":scores, "pipeInterval":pipeInterval, "pipeHeight":pipeHeight}
allDataEnabled.append(playerData)
allDataNotEnabled = []
for testerData in dataNotEnabled:
dataBytes = base64.b64decode(testerData)
jsonData = json.loads(dataBytes.decode('utf8'))
scores = []
pipeInterval = []
pipeHeight = []
i = 0
for run in jsonData["data"]:
if(i != 0 and run['pipeInterval'] == 1410.5):
break
scores.append(run['score'])
pipeInterval.append(run['pipeInterval'])
pipeHeight.append(run['pipeheight'])
i = i + 1
xvals = np.arange(1, len(scores) + 1, 1)
playerData = {"xvals":xvals, "scores":scores, "pipeInterval":pipeInterval, "pipeHeight":pipeHeight}
allDataNotEnabled.append(playerData)
fig, ax = plt.subplots()
#plt.legend(bbox_to_anchor=(1.04,1), loc="upper left")
ax.set_xlabel('Playthrough')
ax.set_ylabel('Score')
ax.set_title('DDA vs. Baseline Scores')
for i in range(len(allDataEnabled)):
ax.plot(allDataEnabled[i]["xvals"], allDataEnabled[i]["scores"], label='DDA_Enabled', color='green')
for i in range(len(allDataNotEnabled)):
ax.plot(allDataNotEnabled[i]["xvals"], allDataNotEnabled[i]["scores"], label='Baseline', color='red')
handles, labels = plt.gca().get_legend_handles_labels()
labels, ids = np.unique(labels, return_index=True)
handles = [handles[i] for i in ids]
plt.legend(handles, labels, loc='best')
#ax.legend()
# %%