-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_loops.sh
executable file
·211 lines (200 loc) · 9.91 KB
/
run_loops.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#!/bin/bash
ROOT_PATH=${PWD}
LOG_FILE=${ROOT_PATH}/box/dtn_simulation_result/dtnrunninglog.txt
function one_loop_func {
echo -e "\033[96m********\n****************\n*********************** one loop *************\n****************\n******\n"
echo "argument are $1 $2 $3 $4 $5"
newargu="$3 $4 $5" # 405 CGR ran405\swith\sCGR
# if we don't add this, run excutable would get "cannot open shared object file: No such file or directory"
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./ns-allinone-3.26/ns-3.26/build/src/ns3dtn-bit/examples/:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./ns-allinone-3.26/ns-3.26/build/:
export LD_LIBRARY_PATH
#export NS_LOG=UdpL4Protocol
echo "./ns-allinone-3.26/ns-3.26/build/src/ns3dtn-bit/examples/ns3.26-ns3dtn-bit-your-example-debug $1 $2 &>${LOG_FILE}"
./ns-allinone-3.26/ns-3.26/build/src/ns3dtn-bit/examples/ns3.26-ns3dtn-bit-your-example-debug $1 $2 &>${LOG_FILE}
#valgrind --track-fds=yes --leak-check=full --undef-value-errors=yes ./ns-allinone-3.26/ns-3.26/build/src/ns3dtn-bit/examples/ns3.26-ns3dtn-bit-your-example-debug $1 $2 &>${LOG_FILE}
./box/ParseLogInLoops.py $newargu
}
#TEG CGR Spray Heuristic
function cycle_func {
echo "in cycle_func"
prefix="loopcycle" # should be [a-z]{1,9}
for x_running_argument_0 in {101..114..1}
do
x_running_argument_1="TEG"
# blabla1 with blabla2, blabla1 must be [a-z,A-Z]+[0-9]+
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="CGR"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="Spray"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="Heuristic"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
done
}
# this run would run TEG and CGR, where both should achive 100% delivery rate
function test_target_simulation_run_func {
echo "in tx1_func"
./changetrace.sh 200
prefix="tx" # should be [a-z]{1,9}
for x_running_argument_0 in {201..201..1}
do
echo "one"
x_running_argument_1="TEG"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="CGR"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="QM"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="Spray"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="Heuristic"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="DirectForward"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
done
}
# one source one destination scenario
function simulation_run_tx1_func {
echo "in tx1_func"
./changetrace.sh 200
prefix="tx" # should be [a-z]{1,9}
for x_running_argument_0 in {201..201..1}
do
echo "one"
#x_running_argument_1="TEG"
#x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
#one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="CGR"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
#x_running_argument_1="Spray"
#x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
#one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
#x_running_argument_1="Heuristic"
#x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
#one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
#x_running_argument_1="DirectForward"
#x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
#one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
#x_running_argument_1="QM"
#x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
#one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
done
}
# random synthetic scenario
function simulation_run_ran_func {
echo "in ran_func"
prefix="ran" # should be [a-z]{1,9}
./changetrace.sh 300
for x_running_argument_0 in {305..314..1}
do
echo "one"
#x_running_argument_1="TEG"
#x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
#one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
#x_running_argument_1="CGR"
#x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
#one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="Spray"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="Heuristic"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="DirectForward"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
done
}
# this is a test target , which TEG,CGR,QM should arrrive 100% delivery rate
function test_target_simulation_run_switch_func {
echo "in switch_func"
prefix="switch" # should be [a-z]{1,9}
./changetrace.sh 400
for x_running_argument_0 in {403..404..1}
do
echo "one"
#x_running_argument_1="TEG"
#x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
#one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="CGR"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="QM"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
done
}
function simulation_run_switch_func {
echo "in switch_func"
prefix="switch" # should be [a-z]{1,9}
./changetrace.sh 400
for x_running_argument_0 in {401..401..1}
do
echo "one"
#x_running_argument_1="TEG"
#x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
#one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="CGR"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="QM"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
done
}
function simulation_run_currcent_func {
echo "in currcent_func"
prefix="currcent" # should be [a-z]{1,9}
./changetrace.sh 500
for x_running_argument_0 in {501..501..1}
do
echo "one"
#x_running_argument_1="TEG"
#x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
#one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="CGR"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
#x_running_argument_1="QM"
#x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
#one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
done
}
function simulation_run_loadbalance_func {
echo "in loadbalance_func"
prefix="loadbal" # should be [a-z]{1,9}
./changetrace.sh 600
for x_running_argument_0 in {606..606..1}
do
echo "one"
#x_running_argument_1="TEG"
#x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
#one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
#x_running_argument_1="CGR"
#x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
#one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
x_running_argument_1="QM"
x_parse_argument="$prefix$x_running_argument_0 with $x_running_argument_1"
one_loop_func $x_running_argument_0 $x_running_argument_1 $x_parse_argument
done
}
#####################################
#test_target_simulation_run_switch_func
#test_target_simulation_run_func
#simulation_run_tx1_func
#simulation_run_ran_func
#simulation_run_switch_func
#simulation_run_currcent_func
simulation_run_loadbalance_func