loosely-coupled-dss/results/paper.sh
2021-05-09 11:07:16 +02:00

75 lines
1.3 KiB
Bash
Executable file

#!/usr/bin/env bash
set -e
wai=$(dirname $(readlink -f "$0"))
scenarios="${wai}/../scenarios"
inputs="${wai}/../inputs.json"
simulator="make -C ${wai}/../ run"
parser="${wai}/../parser.awk"
results="${wai}/results.csv"
nseed=20
run-simulation () {
# Generate inputs
$scenarios $seed $simtime $wakeupsd $wakeupevery $wakeupfor $n_nodes $extended $hint $poff $pon $prx $ptx $datasize $simkey > "$inputs"
# Run simulations
[ -e "$results" ] && { $simulator 2>&1 | $parser | sed 1d >> "$results"; } || { $simulator 2>&1 | $parser > "$results"; }
}
# Default Parameters
seed=0
simtime=7200
wakeupsd=180
wakeupevery=600
wakeupfor=180
n_nodes=5
extended="false"
hint="false"
poff=0
pon=0.4
prx=0.16
ptx=0.16
datasize=1000000
simkey=0
# Baseline
echo "Baseline..."
[ -e "${results}" ] && rm "${results}"
simkey="baseline"
for seed in $(seq 1 $nseed)
do
run-simulation
done
# Hint
echo "Hint..."
hint="true"
simkey="hint"
for seed in $(seq 1 $nseed)
do
run-simulation
done
hint="false"
# Extended
echo "Extended..."
extended="true"
simkey="extended"
for seed in $(seq 1 $nseed)
do
run-simulation
done
extended="false"
# Hint+Extended
echo "Hint + Extended..."
extended="true"
hint="true"
simkey="hintandextended"
for seed in $(seq 1 $nseed)
do
run-simulation
done
extended="false"
hint="false"