-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-agents.sh
More file actions
executable file
·60 lines (49 loc) · 1019 Bytes
/
run-agents.sh
File metadata and controls
executable file
·60 lines (49 loc) · 1019 Bytes
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
#!/bin/sh
sl=12
if [ "$#" -ne 3 ]
then
echo "Usage: $0 [FOLLOWERS] [OPPORTUNISTS] [LEADERS]" >&2
exit 1
fi
echo "Clearing existing knowledge bases ..."
rm agent-kbs/*.pl
echo "Clearing existing log files ..."
rm screenlog.0
echo "Done!"
j=0
if test $1 -gt 0
then
echo "Running extremist followers:"
for i in $(seq 1 $1)
do
screen -L -dmS extremist_follower$i ./TMWhlinterface.py --name $i --role extremist_follower
echo "Extremist follower no $i started!"
j=$i
sleep $sl
done
fi
if test $2 -gt 0
then
echo "Running opportunists:"
k=$(($j+$2))
j=$((j+1))
for i in $(seq $j $k)
do
screen -L -dmS opportunist$i ./TMWhlinterface.py --name $i --role opportunist
echo "Opportunist no $i started!"
j=$i
sleep $sl
done
fi
if test $3 -gt 0
then
echo "Running leaders:"
k=$(($j+$3))
j=$((j+1))
for i in $(seq $j $k)
do
screen -L -dmS leader$i ./TMWhlinterface.py --name $i --role leader
echo "Leader no $i started!"
sleep $sl
done
fi