-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-exp-1.sh
More file actions
executable file
·24 lines (21 loc) · 829 Bytes
/
Copy pathrun-exp-1.sh
File metadata and controls
executable file
·24 lines (21 loc) · 829 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
# check that the number of parameters are correct
if [ "$#" -ne 5 ]; then
echo "ERR: Illegal number of parameters. Expected (n, max_s, min_s, delta_s, a)"
exit 1;
fi
# compile the java class
javac Mypart1.java
CURR_S=$2
# loop until all values for scale factor s from max_s to min_s differing by delta_s are covered
while [ "$(echo "$CURR_S >= $3" | bc -l)" == 1 ]
do
echo "INFO: Parameters used are n=$1, s=$CURR_S, a=$5"
# run the compiled bytecode
java Mypart1 "$1" "$CURR_S" "$5"
# update the value for scaling factor by delta_s
# use bash numeric context to evaluate floating point expressions
# https://www.reddit.com/r/linuxquestions/comments/61u130/linux_arithmetic_on_floating_point_variables_in/
CURR_S=$(echo "$CURR_S - $4" | bc -l)
done
echo "INFO: Experiment terminated successfully"
exit 0