-
Notifications
You must be signed in to change notification settings - Fork 0
/
bruteforce_15.sh
executable file
·67 lines (50 loc) · 2.93 KB
/
bruteforce_15.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
#!/bin/bash
let repetitions=5
let generations=150
let population=40
let iterations=5000
let experiments=15
profile="gitlab_12_months.csv"
mode="mid"
resultFolder="archive"
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
echo "Start $experiments experiments ($mode):"
echo "------------------------------"
for run in `seq 1 20`;
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}.txt
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}.txt
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}.txt
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}.txt
mv schedule.json ${resultFolder}/schedule_${fname}.json
echo "end run and remove population.json"
rm population.json
done