-
Notifications
You must be signed in to change notification settings - Fork 0
/
scriptKTHServer.sh
executable file
·101 lines (69 loc) · 2.19 KB
/
scriptKTHServer.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
# Mani Amoozadeh: bash code for running the simulation on server
#######################################
# check to see if omnet++ is installed
#######################################
echo ""
OPPRUN=${HOME}"/omnetpp-4.2.2/bin/opp_run";
if [ ! -f $OPPRUN ]; then
echo "OMNET++ can not be found!"
exit -1
else
echo "OMNET++ is installed."
fi
###########################
# add bin directory to path
###########################
echo "$PATH" | grep -q "omnetpp-4.2.2/bin"
if [ $? -eq 0 ]
then
echo "omnet++ bin path is already in the path"
else
export PATH=$PATH:/home/maniam/omnetpp-4.2.2/bin
echo "adding the bin folder into path"
fi
############################
# building the whole program
############################
echo "building the project..."
echo ""
make
######################################
# we first check to see if sumo exists
######################################
echo ""
SUMOPATH="/usr/bin/sumo"
if [ ! -f $SUMOPATH ];
then
echo "sumo is not installed!"
exit -1
else
echo "sumo is installed."
fi
###############################
# then we run the python script
###############################
killall python
echo "launching python script in background ..."
echo ""
python sumo-launchd.py -vv -c sumo &
sleep 1
############################
# then we run the simulation
############################
echo ""
echo "run the simulation ..."
echo ""
x=429
while [ $x -le 639 ]
do
opp_runall -j2 opp_run -r $x..$(($x+1)) -u Cmdenv -c Sumo_Cmdenv -n .:../mixim/examples:../mixim/src:../mixim/tests -l application/application -l application/msg/msg -l ../mixim/tests/power/utils/powerTestUtils -l ../mixim/tests/testUtils/miximtestUtils -l ../mixim/src/base/miximbase -l ../mixim/src/modules/miximmodules ProjectConfig.ini
x=$(($x+2))
done
#for i in `seq 0 639`
#do
#opp_run -r $i -u Cmdenv -c Sumo_Cmdenv -n .:../mixim/examples:../mixim/src:../mixim/tests -l application/application -l application/msg/msg -l ../mixim/tests/power/utils/powerTestUtils -l ../mixim/tests/testUtils/miximtestUtils -l ../mixim/src/base/miximbase -l ../mixim/src/modules/miximmodules ProjectConfig.ini
#done
# wait for the above command to be completed
wait $!
echo ""
echo "simulation completed."