-
Notifications
You must be signed in to change notification settings - Fork 0
/
stepwise.sh
executable file
·70 lines (54 loc) · 3.12 KB
/
stepwise.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
#!/bin/bash
let repetitions=5
let generations=90
let population=40
let iterations=3000
let stepsize=5
profile="gitlab_12_months.csv"
mode="high"
resultFolder="stepwise"
echo "======================================================================="
echo "| START EXPERIMENTS"
echo "======================================================================="
echo "create result folder"
mkdir -p ${resultFolder}
awk 'BEGIN{ FS="=";OFS="=" } {if($1==pname) $2=newval; print $0;}' pname="POPULATION_SIZE" newval="$population" fenrir.properties > tmp.properties && mv tmp.properties fenrir.properties
awk 'BEGIN{ FS="=";OFS="=" } {if($1==pname) $2=newval; print $0;}' pname="NUM_GENERATIONS" newval="$generations" fenrir.properties > tmp.properties && mv tmp.properties fenrir.properties
for step in `seq 2 10`;
do
let experiments=step*stepsize
echo "Start with $experiments experiments ($mode):"
echo "------------------------------"
for run in `seq 1 ${repetitions}`;
do
echo "-> random sampling run $run"
fname="randomSampling_${mode}_exp${experiments}_sample${population}_${run}"
java -jar fenrir-1.0-SNAPSHOT.jar -e experiments/experiments_${experiments}_${mode}.json -t traffic_profiles/${profile} -randomSampling ${population} > ${resultFolder}/log_${fname}.txt 2>&1
mv consumption.csv ${resultFolder}/consumption_${fname}.csv
mv visual.txt ${resultFolder}/visual_${fname}.csv
mv schedule.json ${resultFolder}/schedule_${fname}.json
echo "-> GA run $run"
fname="GA_${mode}_exp${experiments}_pop${population}_gen${generations}_${run}"
java -jar fenrir-1.0-SNAPSHOT.jar -e experiments/experiments_${experiments}_${mode}.json -t traffic_profiles/${profile} > ${resultFolder}/log_${fname}.txt 2>&1
mv stats.csv ${resultFolder}/stats_${fname}.csv
mv consumption.csv ${resultFolder}/consumption_${fname}.csv
mv visual.txt ${resultFolder}/visual_${fname}.csv
mv schedule.json ${resultFolder}/schedule_${fname}.json
echo "-> localSearch run $run"
fname="localSearch_${mode}_exp${experiments}_it${iterations}_$run"
java -jar fenrir-1.0-SNAPSHOT.jar -e experiments/experiments_${experiments}_${mode}.json -t traffic_profiles/${profile} -localSearch ${iterations} > ${resultFolder}/log_${fname}.txt 2>&1
mv stats.csv ${resultFolder}/stats_${fname}.csv
mv consumption.csv ${resultFolder}/consumption_${fname}.csv
mv visual.txt ${resultFolder}/visual_${fname}.csv
mv schedule.json ${resultFolder}/schedule_${fname}.json
echo "-> simulated annealing run $run"
fname="SA_${mode}_exp${experiments}_it${iterations}_$run"
java -jar fenrir-1.0-SNAPSHOT.jar -e experiments/experiments_${experiments}_${mode}.json -t traffic_profiles/${profile} -SA ${iterations} > ${resultFolder}/log_${fname}.txt 2>&1
mv stats.csv ${resultFolder}/stats_${fname}.csv
mv consumption.csv ${resultFolder}/consumption_${fname}.csv
mv visual.txt ${resultFolder}/visual_${fname}.csv
mv schedule.json ${resultFolder}/schedule_${fname}.json
echo "end run and remove population.json"
rm population.json
done
done