-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraph_create.py
More file actions
83 lines (64 loc) · 2.43 KB
/
graph_create.py
File metadata and controls
83 lines (64 loc) · 2.43 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
"""
Script for creating visualizations of the results from different parameters.
Set csv_file_name to the folder containing the generated csv and uncoment the
block corresponding to the graph desired.
"""
import csv
from matplotlib import pyplot as plt
columnone = []
fitness = []
games = []
seconds = []
turns = []
csv_file_name = "./results/min_visits.csv"
with open(csv_file_name, "r") as csvfile:
csvreader = csv.reader(csvfile, delimiter = ",", quotechar="|")
next(csvreader)
# Add necessary information
for row in csvreader:
columnone.append(round(float(row[0]), 2))
fitness.append(round(float(row[1]), 2))
games.append(round(float(row[2]), 2))
seconds.append(round(float(row[3]) / games[0], 2))
turns.append(round(float(row[4]), 2))
### ITERATIONS ###
# plt.plot(columnone, fitness, "-o")
# plt.title("Win Rates for Iterations")
# plt.xlabel("Iterations")
# plt.ylabel("Win Rate ({} games)".format(int(games[0])))
# plt.gca().set_ylim([0, 1])
# plt.show()
# plt.plot(columnone, turns, "-o")
# plt.title("Average Turns for Different Iterations")
# plt.xlabel("Iterations")
# plt.ylabel("Average Turns ({} games)".format(int(games[0])))
# plt.show()
# plt.plot(columnone, seconds, "-o")
# plt.title("Average Game Time for Different Iterations")
# plt.xlabel("Iterations")
# plt.ylabel("Average time (seconds)")
# plt.show()
### EXPLOTARTION PARAMETER ###
# plt.plot(columnone, fitness, "-o")
# plt.title("Win Rates for Different Exploration Constant")
# plt.xlabel("Exploration Constant")
# plt.ylabel("Win Rate ({} games)".format(int(games[0])))
# plt.gca().set_ylim([0, 1])
# plt.show()
# plt.plot(columnone, turns, "-o")
# plt.title("Average Turns for Different Exploration Constants")
# plt.xlabel("Exploration Constant")
# plt.ylabel("Average Turns ({} games)".format(int(games[0])))
# plt.show()
# plt.plot(columnone, seconds, "-o")
# plt.title("Average Game Time for Different Exploration Constants")
# plt.xlabel("Exploration Constant")
# plt.ylabel("Average time (seconds)")
# plt.show()
### MIN VISITS ###
# plt.plot(columnone, fitness, "-o")
# plt.title("Win Rates for Different Minimum Visits")
# plt.xlabel("Minimum Visits")
# plt.ylabel("Win Rate ({} games)".format(int(games[0])))
# plt.gca().set_ylim([0, 1])
# plt.show()