-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresult.sh
executable file
·172 lines (160 loc) · 7.7 KB
/
result.sh
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
#!/bin/bash
cd results;
rm black/*
#gets easy result data
array=`wc -l *.dat | grep "100 " | awk -F "100 " '{print $2}'`
array=`ls result+black-3+white-*.dat`
for i in $array
do
ctr=0
sum=0
avg=0
while read line
do
val=`echo $line | awk -F " " '{print $2}'`
if [[ $val -gt 0 ]]; then
val=1
else
#statements
val=0
fi
ctr=$(($ctr+$val))
# ctr=$(($ctr+1))
# avg=$(($sum + $val * $ctr))
# sum=$(($sum+$val))
# avg=$(($avg / $ctr))
echo "$ctr">> "black/$i"
done < "$i"
# title=`echo $i | awk -F "result+" '{print $2}' | awk -F "." '{print $1}' | tr '-' ' ' | tr '+' ' '`
done
name="UCT-Heuristic vs UCT-Random"
echo "reset
set term postscript
set output \"./plot/graphs/plot.ps\"
set xlabel 'Episode'
set ylabel 'Total Accumulated Wins'
plot x with lines linecolor rgb 'black' lt 1 notitle, x*0.5 with lines linecolor rgb 'black' lt 1 notitle, \
'./black/result+black-3+white-0.dat' with lines linecolor rgb 'red' lt 1 lw 2 title 'Heuristic vs Random'
" | gnuplot
convert -rotate 90 -flatten plot/graphs/plot.ps ~/Desktop/data/plot0.png
name="UCT-Heuristic vs UCT-Random"
echo "reset
set term postscript
set output \"./plot/graphs/plot.ps\"
set xlabel 'Episode'
set ylabel 'Total Accumulated Wins'
plot x with lines linecolor rgb 'black' lt 1 notitle, x*0.5 with lines linecolor rgb 'black' lt 1 notitle, \
'./black/result+black-1-13+white-1-10.dat' with lines linecolor rgb 'red' lt 1 lw 2 title 'Level 1',\
'./black/result+black-5-13+white-5-10.dat' with lines linecolor rgb 'blue' lt 1 lw 2 title 'Level 5'
" | gnuplot
convert -rotate 90 -flatten plot/graphs/plot.ps ~/Desktop/data/plot1.png
name="Heuristic vs UCT-Random"
echo "reset
set term postscript
set output \"./plot/graphs/plot.ps\"
set xlabel 'Episode'
set ylabel 'Total Accumulated Wins'
plot x with lines linecolor rgb 'black' lt 1 notitle, x*0.5 with lines linecolor rgb 'black' lt 1 notitle, \
'./black/result+black-3+white-1-10.dat' with lines linecolor rgb 'red' lt 1 lw 2 title 'Level 1', \
'./black/result+black-3+white-5-10.dat' with lines linecolor rgb 'blue' lt 1 lw 2 title 'Level 5', \
'./black/result+black-3+white-10-10.dat' with lines linecolor rgb 'green' lt 1 lw 2 title 'Level 10'
" | gnuplot
convert -rotate 90 -flatten plot/graphs/plot.ps ~/Desktop/data/plot2.png
name="Heuristic vs UCT-Heuristic"
echo "reset
set term postscript
set output \"./plot/graphs/plot.ps\"
set xlabel 'Episode'
set ylabel 'Total Accumulated Wins'
plot x with lines linecolor rgb 'black' lt 1 notitle, x*0.5 with lines linecolor rgb 'black' lt 1 notitle, \
'./black/result+black-3+white-1-13.dat' with lines linecolor rgb 'red' lt 1 lw 2 title 'Level 1', \
'./black/result+black-3+white-5-13.dat' with lines linecolor rgb 'blue' lt 1 lw 2 title 'Level 5', \
'./black/result+black-3+white-10-13.dat' with lines linecolor rgb 'green' lt 1 lw 2 title 'Level 10'
" | gnuplot
convert -rotate 90 -flatten plot/graphs/plot.ps ~/Desktop/data/plot3.png
name="Heuristic vs UCT-Rave-Random"
echo "reset
set term postscript
set output \"./plot/graphs/plot.ps\"
set xlabel 'Episode'
set ylabel 'Total Accumulated Wins'
plot x with lines linecolor rgb 'black' lt 1 notitle, x*0.5 with lines linecolor rgb 'black' lt 1 notitle, \
'./black/result+black-3+white-1-20.dat' with lines linecolor rgb 'red' lt 1 lw 2 title 'Level 1', \
'./black/result+black-3+white-5-20.dat' with lines linecolor rgb 'blue' lt 1 lw 2 title 'Level 5', \
'./black/result+black-3+white-10-20.dat' with lines linecolor rgb 'green' lt 1 lw 2 title 'Level 10'
" | gnuplot
convert -rotate 90 -flatten plot/graphs/plot.ps ~/Desktop/data/plot4.png
name="Heuristic vs UCT-Rave-Heuristic"
echo "reset
set term postscript
set output \"./plot/graphs/plot.ps\"
set xlabel 'Episode'
set ylabel 'Total Accumulated Wins'
plot x with lines linecolor rgb 'black' lt 1 notitle, x*0.5 with lines linecolor rgb 'black' lt 1 notitle, \
'./black/result+black-3+white-1-23.dat' with lines linecolor rgb 'red' lt 1 lw 2 title 'Level 1', \
'./black/result+black-3+white-5-23.dat' with lines linecolor rgb 'blue' lt 1 lw 2 title 'Level 5', \
'./black/result+black-3+white-10-23.dat' with lines linecolor rgb 'green' lt 1 lw 2 title 'Level 10'
" | gnuplot
convert -rotate 90 -flatten plot/graphs/plot.ps ~/Desktop/data/plot5.png
name="Self Play Level 5"
echo "reset
set term postscript
set output \"./plot/graphs/plot.ps\"
set xlabel 'Episode'
set ylabel 'Total Accumulated Wins'
plot x with lines linecolor rgb 'black' lt 1 notitle, x*0.5 with lines linecolor rgb 'black' lt 1 notitle, \
'./black/result+black-5-10+white-5-10.dat' with lines linecolor rgb 'red' lt 1 lw 2 title 'UCT-Random', \
'./black/result+black-5-13+white-5-13.dat' with lines linecolor rgb 'blue' lt 1 lw 2 title 'UCT-Heuristic', \
'./black/result+black-5-20+white-5-20.dat' with lines linecolor rgb 'green' lt 1 lw 2 title 'UCT-Rave-Random', \
'./black/result+black-5-23+white-5-23.dat' with lines linecolor rgb 'purple' lt 1 lw 2 title 'UCT-Rave-Heuristic'
" | gnuplot
convert -rotate 90 -flatten plot/graphs/plot.ps ~/Desktop/data/plot6.png
name="UCT-Rave vs UCT, Level 5"
echo "reset
set term postscript
set output \"./plot/graphs/plot.ps\"
set xlabel 'Episode'
set ylabel 'Total Accumulated Wins'
plot x with lines linecolor rgb 'black' lt 1 notitle, x*0.5 with lines linecolor rgb 'black' lt 1 notitle, \
'./black/result+black-5-20+white-5-10.dat' with lines linecolor rgb 'red' lt 1 lw 2 title 'Random Policy', \
'./black/result+black-5-23+white-5-13.dat' with lines linecolor rgb 'blue' lt 1 lw 2 title 'Heuristic Policy'
" | gnuplot
convert -rotate 90 -flatten plot/graphs/plot.ps ~/Desktop/data/plot7.png
name="UCT-Random vs Random"
echo "reset
set term postscript
set output \"./plot/graphs/plot.ps\"
set xlabel 'Episode'
set ylabel 'Total Accumulated Wins'
plot x with lines linecolor rgb 'black' lt 1 notitle, x*0.5 with lines linecolor rgb 'black' lt 1 notitle, \
'./black/result+black-1-10+white-1.dat' with lines linecolor rgb 'red' lt 1 lw 2 title 'Raw Reward', \
'./black/reward1.dat' with lines linecolor rgb 'blue' lt 1 lw 2 title 'Normalized Reward'
" | gnuplot
convert -rotate 90 -flatten plot/graphs/plot.ps ~/Desktop/data/plot8.png
name="Cumulative"
echo "reset
set term postscript
set output \"./plot/graphs/plot.ps\"
set xlabel 'Episode'
set ylabel 'Total Accumulated Wins'
plot x with lines linecolor rgb 'black' lt 1 notitle, x*0.5 with lines linecolor rgb 'black' lt 1 notitle, \
'./black/result+black-3+white-10-10.dat' with lines linecolor rgb 'red' lt 1 lw 2 title 'UCT-Random', \
'./black/result+black-3+white-10-13.dat' with lines linecolor rgb 'blue' lt 1 lw 2 title 'UCT-Heuristic', \
'./black/result+black-3+white-10-20.dat' with lines linecolor rgb 'green' lt 1 lw 2 title 'UCT-Rave-Random', \
'./black/result+black-3+white-10-23.dat' with lines linecolor rgb 'purple' lt 1 lw 2 title 'UCT-Rave-Heuristic'
" | gnuplot
convert -rotate 90 -flatten plot/graphs/plot.ps ~/Desktop/data/plot9.png
name="Cumulative"
echo "reset
set term postscript
set output \"./plot/graphs/plot.ps\"
set xlabel 'Episode'
set ylabel 'Total Accumulated Wins'
plot x with lines linecolor rgb 'black' lt 1 notitle, x*0.5 with lines linecolor rgb 'black' lt 1 notitle, \
'./black/result+black-0+white-5-10.dat' with lines linecolor rgb 'red' lt 1 lw 2 title 'UCT-Random', \
'./black/result+black-0+white-5-13.dat' with lines linecolor rgb 'blue' lt 1 lw 2 title 'UCT-Heuristic', \
'./black/result+black-0+white-5-20.dat' with lines linecolor rgb 'green' lt 1 lw 2 title 'UCT-Rave-Random', \
'./black/result+black-0+white-5-23.dat' with lines linecolor rgb 'purple' lt 1 lw 2 title 'UCT-Rave-Heuristic'
" | gnuplot
convert -rotate 90 -flatten plot/graphs/plot.ps ~/Desktop/data/plot10.png
cd ../