-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrawl_twoUnitWithInsp_v2.sh
59 lines (54 loc) · 1.36 KB
/
crawl_twoUnitWithInsp_v2.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
#!/bin/bash
# Automatic call of the two system simulator with varying params
# Usage: ./twoUnitWithInsp_v2 mlt mrt d Delta T seed
# SED: http://unix.stackexchange.com/questions/24140/
# return-only-the-portion-of-a-line-after-a-matching-pattern
# $1 = mlt
# $2 = mrt
# $3 = d
# $4 = Delta
# $5 = T
# $6 = seed
# $7 = index of dynamic parameter
# $8 = increase parameter by
# $9 = number of increases
# $10 = output file name
i="0"
echo `date` >> ./testResults/${10}.csv
echo 'mlt:' $1 >> ./testResults/${10}.csv
echo 'mrt:' $2 >> ./testResults/${10}.csv
echo 'd:' $3 >> ./testResults/${10}.csv
echo 'Delta:' $4 >> ./testResults/${10}.csv
echo 'T:' $5 >> ./testResults/${10}.csv
echo 'seed:' $6 >> ./testResults/${10}.csv
echo 'dynamic parameter $' $7 >> ./testResults/${10}.csv
echo 'incr by:' $8 >> ./testResults/${10}.csv
echo 'incr rnd:' $9 >> ./testResults/${10}.csv
initial=${!7}
plus=$(($8*$9))
target=$(( $initial + $plus ))
mlt=$1
mrt=$2
d=$3
delta=$4
t=$5
seed=$6
case $7 in
1 )
var="mlt";;
2 )
var="mrt";;
3 )
var="d";;
4 )
var="delta";;
5 )
var="t";;
esac
check=${!var}
while [ $check -lt $target ]
do
echo $check`./twoUnitWithInsp_v2 $mlt $mrt $d $delta $t $seed | sed -n -e 's/^.*= /;/p' | sed '/[0-9]\./s/\./,/g'` >> ./testResults/${10}.csv
check=$(( $check + $8 ))
let $var=$check
done