Repository navigation
Expand file tree
/
Copy pathsim.sh
More file actions
executable file
·69 lines (53 loc) · 1.55 KB
/
Copy pathsim.sh
File metadata and controls
executable file
·69 lines (53 loc) · 1.55 KB
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
#!/bin/sh
####################################################################
# author: Hannaneh Barahouei Pasandi
# This is a script to run my simulator program and my RL agent to find the best protocol.
# It:
#
#
####################################################################
# ------------------------ General script information
#binary=simulator
#op1=logfile.txt # "permanent" data files
#op2=throughput.txt
#op5=a # temporary data files
#op6=b
#op7=c
#op8=d
#D=0 # are we debugging?
#---------------- Reading state file --------------------------------
#INPUT=states.txt
#OLDIFS=$IFS
#IFS=,
#[ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; }
#while read ack backoff prob cw csma protocol
#do
# echo "ack : $ack"
# echo "backoff : $backoff"
# echo "prob : $prob"
# echo "cw : $cw"
# echo "csma : $csma"
# echo "protocol : $protocol"
#done < $INPUT
#IFS=$OLDIFS
#echo "Test" >> input.txt
#while IFS= read -r line;
#do
# echo "$line" > input.txt
#done <$INPUT
#echo "completed"
# --------------------------------- Compile new binary -------------------
i=0
while [ "$i" -le 59 ]; do
echo sim: Compiling...
rm -f $binary
make
# ------------------------------ If it compiled, run it ---------------
if [ -f $binary ]
then
echo sim: Successful compilation...
./simulator "$i"
i=$(($i+1))
fi
done
#---------------------------------- Read the reward ---------------------