forked from krocki/LOGO-TSP-Solver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresults.sh
executable file
·47 lines (38 loc) · 897 Bytes
/
results.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
#!/bin/bash
# get final found length of path
function length
{
printf "%s" $(cat $1 | \
grep "New global minimum" | \
tail -n1 | \
cut -d">" -f2 | \
cut -d" " -f3)
}
# get time
function path_time
{
printf "%s" $(tail -n1 $1 | \
cut -d" " -f 3)
}
# get accuracy
function acc
{
printf "%s" $(cat $1 | \
grep "New global minimum" | \
tail -n1 | \
cut -d">" -f2 | \
cut -d" " -f5)
}
out=${1:-data.csv}
printf "1,2,4,8,16,32,64,gpu,\n" > $out
let count=0
for f in $(ls results/* | sort -V); do
printf "%s," $(path_time $f) >> $out
let count=$count+1
if [ $((count%8)) -eq 0 ]; then
printf "\n" >> $out
fi
done
# reserved data
# printf "%s," $(length $f)
# printf "%s," $(acc $f) | sed "s/%//"