From d42da3fbffa3f62b3316588fee441f144b3b8d02 Mon Sep 17 00:00:00 2001 From: giomba Date: Mon, 16 Dec 2019 19:20:41 +0100 Subject: [PATCH] [simulation] final simulation scripts --- simulation/main.sh | 7 +++++-- simulation/plot.py | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/simulation/main.sh b/simulation/main.sh index a83fb24..d8881bc 100755 --- a/simulation/main.sh +++ b/simulation/main.sh @@ -3,13 +3,13 @@ REPOSITORY=$(pwd) CONTIKI=/home/giomba/workspace/uni/contiki/ SIMULATION=/home/giomba/workspace/uni/anaws-proj/cooja/simulation-prng.csc -REPEAT=20 +REPEAT=30 # Setup environment mkdir -p "$REPOSITORY/simulation/results" # Setup simulation parameters -for KAPPA in 5; do +for KAPPA in 1 2 3 4 5; do for I_MIN in 20 18 16; do I_MAX=$((22 - I_MIN)) # 22 =~ 70 minutes @@ -21,6 +21,9 @@ for KAPPA in 5; do # Run simulation for (( i = 0; i<=$REPEAT; i++ )); do + cd "$REPOSITORY/cooja" + sed -i "s_.*<\\/randomseed>_$i<\\/randomseed>_g" simulation-prng.csc + cd "$CONTIKI/tools/cooja" ant run_nogui -Dargs="$SIMULATION" & diff --git a/simulation/plot.py b/simulation/plot.py index 93127a9..873de68 100644 --- a/simulation/plot.py +++ b/simulation/plot.py @@ -31,6 +31,8 @@ handles = [] for i in df['i_min'].unique(): handles.append(mpatches.Patch(color=getcolor(i), label='Imin = ' + str(i))) +plt.ylim([0, 1400]) + plt.legend(handles=handles) plt.show()