-
Notifications
You must be signed in to change notification settings - Fork 0
/
delay.sh
executable file
·33 lines (25 loc) · 875 Bytes
/
delay.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
#! /bin/bash
# remove existing log files
rm -f delay.log
# initialize lambda, mu and K
mu=1000
simtime=100
# for each simulation duration
for lambda in 500 700 900 1000 1100 1300 ; do
for K in 1 5 10 15 20 25 30 40 50 70 100 ; do
# output the current simulation
echo "Simulating [simtime " $simtime "/ lambda " $lambda "/ mu " $mu "/ K " $K "]"
# run the simulation
./buffer tracefile.log $simtime $lambda $mu $K
# get the statistics
awk -f postprocess.awk tracefile.log > temporary.log
# store the averaged delay packets in an overall
# log, preceded by the relative simulation parameters
awk -v t=$simtime -v l=$lambda -v m=$mu -v k=$K \
'$1 == "delay" {printf("%10.2f %5d %5d %5d %10s\n", t, l, m, k, $2)}' \
temporary.log >> delay_$lambda.log
done
done
# remove temporary trace and log file
rm -f tracefile.log
rm -f temporary.log