-
Notifications
You must be signed in to change notification settings - Fork 2
/
collect_evaluations.sh
executable file
·80 lines (74 loc) · 2.87 KB
/
collect_evaluations.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
#!/bin/bash
clean_exit() {
killall beacon-localize
exit
}
trap 'clean_exit' SIGINT
evaluations=("evaluate-los" "evaluate-nlos" "evaluate-nlos2" "evaluate-nlos3")
sweeps=("by-measurements" "by-delay-sigma" "by-delay-mean")
for evaluation in "${evaluations[@]}"
do
for sweep in "${sweeps[@]}"
do
flags="--$evaluation --$sweep"
echo "Evaluating $flags..."
file="evaluations/${evaluation}_$sweep.csv"
bin/beacon-localize $flags --eval-run-i 0 > tmp0.txt &
pid0=$!
bin/beacon-localize $flags --eval-run-i 1 > tmp1.txt &
pid1=$!
bin/beacon-localize $flags --eval-run-i 2 > tmp2.txt &
pid2=$!
bin/beacon-localize $flags --eval-run-i 3 > tmp3.txt &
pid3=$!
bin/beacon-localize $flags --eval-run-i 4 > tmp4.txt &
pid4=$!
wait $pid0
wait $pid1
wait $pid2
wait $pid3
wait $pid4
cat tmp0.txt | sed "s/^.*\r//" | awk '{ORS=" "; print $4, $9; for(i=10;i<=NF;++i) print $i; print "\n"}' | tr -d ',' > $file
cat tmp1.txt | sed "s/^.*\r//" | awk '{ORS=" "; print $4, $9; for(i=10;i<=NF;++i) print $i; print "\n"}' | tr -d ',' >> $file
cat tmp2.txt | sed "s/^.*\r//" | awk '{ORS=" "; print $4, $9; for(i=10;i<=NF;++i) print $i; print "\n"}' | tr -d ',' >> $file
cat tmp3.txt | sed "s/^.*\r//" | awk '{ORS=" "; print $4, $9; for(i=10;i<=NF;++i) print $i; print "\n"}' | tr -d ',' >> $file
cat tmp4.txt | sed "s/^.*\r//" | awk '{ORS=" "; print $4, $9; for(i=10;i<=NF;++i) print $i; print "\n"}' | tr -d ',' >> $file
sed -i '/^ *$/d' $file
done
done
methods=("" "--first-peak" "--max-peak" "--triangulation" "--fixed-delays" "--manual-delays")
for evaluation in "${evaluations[@]}"
do
for method in "${methods[@]}"
do
flags="--$evaluation $method"
echo "Evaluating $flags..."
file="evaluations/${evaluation}_${method:2}.csv"
bin/beacon-localize $flags --eval-run-i 0 > tmp0.txt &
pid0=$!
bin/beacon-localize $flags --eval-run-i 1 > tmp1.txt &
pid1=$!
bin/beacon-localize $flags --eval-run-i 2 > tmp2.txt &
pid2=$!
bin/beacon-localize $flags --eval-run-i 3 > tmp3.txt &
pid3=$!
bin/beacon-localize $flags --eval-run-i 4 > tmp4.txt &
pid4=$!
wait $pid0
wait $pid1
wait $pid2
wait $pid3
wait $pid4
cat tmp0.txt | sed "s/^.*\r//" | awk '{print $6}' | tr -d ',' > $file
cat tmp1.txt | sed "s/^.*\r//" | awk '{print $6}' | tr -d ',' >> $file
cat tmp2.txt | sed "s/^.*\r//" | awk '{print $6}' | tr -d ',' >> $file
cat tmp3.txt | sed "s/^.*\r//" | awk '{print $6}' | tr -d ',' >> $file
cat tmp4.txt | sed "s/^.*\r//" | awk '{print $6}' | tr -d ',' >> $file
sed -i '/^ *$/d' $file
done
done
rm tmp0.txt
rm tmp1.txt
rm tmp2.txt
rm tmp3.txt
rm tmp4.txt