/
plot-forward.sh
executable file
·133 lines (102 loc) · 7.5 KB
/
plot-forward.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
#!/bin/sh
find ./output/ -maxdepth 1 -empty -exec rm {} \;
./average.sh
for i in blocks elevators freecell gripper hanoi ; do #
gnuplot << EOF
set terminal postscript eps rounded color size 5,2
#set output "charts/$i-forward-time.eps"
set output "| tee charts/$i-forward-time.eps | ps2pdf -dEPSCrop - charts/$i-forward-time.pdf"
set xtics rotate by -45
set ylabel "Time [Seconds]"
set logscale y
set grid y
set key out top Left reverse
plot "output/$i-forward-dfs-h_0.out.avg" using 2:xtic(1) title 'DFS h_0' with linespoints lw 2, \
"output/$i-forward-dfs-h_diff.out.avg" using 2:xtic(1) title 'DFS h_{diff}' with linespoints lw 2, \
"output/$i-forward-dfs-h_add.out.avg" using 2:xtic(1) title 'DFS h_{add}' with linespoints lw 2, \
"output/$i-forward-dfs-h_max.out.avg" using 2:xtic(1) title 'DFS h_{max}' with linespoints lw 2, \
"output/$i-forward-bfs.out.avg" using 2:xtic(1) title 'BFS' with linespoints lw 2, \
"output/$i-forward-iddfs.out.avg" using 2:xtic(1) title 'IDDFS' with linespoints lw 2, \
"output/$i-forward-a-star-h_0.out.avg" using 2:xtic(1) title 'A* h_0' with linespoints lw 2, \
"output/$i-forward-a-star-h_diff.out.avg" using 2:xtic(1) title 'A* h_{diff}' with linespoints lw 2, \
"output/$i-forward-a-star-h_add.out.avg" using 2:xtic(1) title 'A* h_{add}' with linespoints lw 2, \
"output/$i-forward-a-star-h_max.out.avg" using 2:xtic(1) title 'A* h_{max}' with linespoints lw 2, \
"output/$i-forward-wa-star-h_0.out.avg" using 2:xtic(1) title 'WA* h_0' with linespoints lw 2, \
"output/$i-forward-wa-star-h_diff.out.avg" using 2:xtic(1) title 'WA* h_{diff}' with linespoints lw 2, \
"output/$i-forward-wa-star-h_add.out.avg" using 2:xtic(1) title 'WA* h_{add}' with linespoints lw 2, \
"output/$i-forward-wa-star-h_max.out.avg" using 2:xtic(1) title 'WA* h_{max}' with linespoints lw 2
EOF
gnuplot << EOF
set terminal postscript eps rounded color size 5,7
set output "| tee charts/$i-forward.eps | ps2pdf -dEPSCrop - charts/$i-forward.pdf"
set multiplot layout 4,1 scale 1,1
set format x ""
unset xtics
set ylabel "Time [Seconds]"
set logscale y
set grid y
set lmargin 12
set rmargin 20
#set key inside left top vertical Left reverse enhanced autotitles columnhead nobox
set key out top Left reverse
plot "output/$i-forward-dfs-h_0.out.avg" using 2 title 'DFS h_0' with linespoints lw 2, \
"output/$i-forward-dfs-h_diff.out.avg" using 2 title 'DFS h_{diff}' with linespoints lw 2, \
"output/$i-forward-dfs-h_add.out.avg" using 2 title 'DFS h_{add}' with linespoints lw 2, \
"output/$i-forward-dfs-h_max.out.avg" using 2 title 'DFS h_{max}' with linespoints lw 2, \
"output/$i-forward-bfs.out.avg" using 2 title 'BFS' with linespoints lw 2, \
"output/$i-forward-iddfs.out.avg" using 2 title 'IDDFS' with linespoints lw 2, \
"output/$i-forward-a-star-h_0.out.avg" using 2 title 'A* h_0' with linespoints lw 2, \
"output/$i-forward-a-star-h_diff.out.avg" using 2 title 'A* h_{diff}' with linespoints lw 2, \
"output/$i-forward-a-star-h_add.out.avg" using 2 title 'A* h_{add}' with linespoints lw 2, \
"output/$i-forward-a-star-h_max.out.avg" using 2 title 'A* h_{max}' with linespoints lw 2, \
"output/$i-forward-wa-star-h_0.out.avg" using 2 title 'WA* h_0' with linespoints lw 2, \
"output/$i-forward-wa-star-h_diff.out.avg" using 2 title 'WA* h_{diff}' with linespoints lw 2, \
"output/$i-forward-wa-star-h_add.out.avg" using 2 title 'WA* h_{add}' with linespoints lw 2, \
"output/$i-forward-wa-star-h_max.out.avg" using 2 title 'WA* h_{max}' with linespoints lw 2
set ylabel "# of visited nodes"
plot "output/$i-forward-dfs-h_0.out.avg" using 3:xtic(1) title 'DFS h_0' with linespoints lw 2, \
"output/$i-forward-dfs-h_diff.out.avg" using 3:xtic(1) title 'DFS h_{diff}' with linespoints lw 2, \
"output/$i-forward-dfs-h_add.out.avg" using 3:xtic(1) title 'DFS h_{add}' with linespoints lw 2, \
"output/$i-forward-dfs-h_max.out.avg" using 3:xtic(1) title 'DFS h_{max}' with linespoints lw 2, \
"output/$i-forward-bfs.out.avg" using 3:xtic(1) title 'BFS' with linespoints lw 2, \
"output/$i-forward-iddfs.out.avg" using 3:xtic(1) title 'IDDFS' with linespoints lw 2, \
"output/$i-forward-a-star-h_0.out.avg" using 3:xtic(1) title 'A* h_0' with linespoints lw 2, \
"output/$i-forward-a-star-h_diff.out.avg" using 3:xtic(1) title 'A* h_{diff}' with linespoints lw 2, \
"output/$i-forward-a-star-h_add.out.avg" using 3:xtic(1) title 'A* h_{add}' with linespoints lw 2, \
"output/$i-forward-a-star-h_max.out.avg" using 3:xtic(1) title 'A* h_{max}' with linespoints lw 2, \
"output/$i-forward-wa-star-h_0.out.avg" using 3:xtic(1) title 'WA* h_0' with linespoints lw 2, \
"output/$i-forward-wa-star-h_diff.out.avg" using 3:xtic(1) title 'WA* h_{diff}' with linespoints lw 2, \
"output/$i-forward-wa-star-h_add.out.avg" using 3:xtic(1) title 'WA* h_{add}' with linespoints lw 2, \
"output/$i-forward-wa-star-h_max.out.avg" using 3:xtic(1) title 'WA* h_{max}' with linespoints lw 2
unset logscale y
set ylabel "Length of solution"
#set style fill solid 1.00 border -1
#set style rectangle back fc lt -3 fillstyle solid 1.00 border -1
#set style histogram clustered gap 1
plot "output/$i-forward-bfs.out.avg" using 5:xtic(1) title 'BFS' with linespoints lw 2, \
"output/$i-forward-iddfs.out.avg" using 5:xtic(1) title 'IDDFS' with linespoints lw 2, \
"output/$i-forward-a-star-h_diff.out.avg" using 5:xtic(1) title 'A* h_{diff}' with linespoints lw 2, \
"output/$i-forward-a-star-h_add.out.avg" using 5:xtic(1) title 'A* h_{add}' with linespoints lw 2, \
"output/$i-forward-wa-star-h_0.out.avg" using 5:xtic(1) title 'WA* h_0' with linespoints lw 2, \
"output/$i-forward-wa-star-h_diff.out.avg" using 5:xtic(1) title 'WA* h_{diff}' with linespoints lw 2, \
"output/$i-forward-wa-star-h_add.out.avg" using 5:xtic(1) title 'WA* h_{add}' with linespoints lw 2, \
"output/$i-forward-wa-star-h_max.out.avg" using 5:xtic(1) title 'WA* h_{max}' with linespoints lw 2
unset logscale y
#set origin 0.4,0.1
set ylabel "Memory [MB]"
set xtics rotate by -45
plot "output/$i-forward-dfs-h_add.out.avg" using (\$4/1024/1024):xtic(1) title 'DFS' with linespoints lw 2, \
"output/$i-forward-bfs.out.avg" using (\$4/1024/1024):xtic(1) title 'BFS' with linespoints lw 2, \
"output/$i-forward-iddfs.out.avg" using (\$4/1024/1024):xtic(1) title 'IDDFS' with linespoints lw 2, \
"output/$i-forward-a-star-h_0.out.avg" using (\$4/1024/1024):xtic(1) title 'A* h_0' with linespoints lw 2, \
"output/$i-forward-a-star-h_add.out.avg" using (\$4/1024/1024):xtic(1) title 'A*' with linespoints lw 2, \
"output/$i-forward-wa-star-h_0.out.avg" using (\$4/1024/1024):xtic(1) title 'WA* h_0' with linespoints lw 2, \
"output/$i-forward-wa-star-h_add.out.avg" using (\$4/1024/1024):xtic(1) title 'WA*' with linespoints lw 2
set nomultiplot
#set terminal png transparent nocrop enhanced font "/usr/share/fonts/truetype/arial.ttf" 8 size 500,500
#set output "charts/$i-forward.png"
#replot
EOF
done
: <<'END'
ps2pdf