-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJetris.sh
More file actions
executable file
·62 lines (55 loc) · 1.57 KB
/
Jetris.sh
File metadata and controls
executable file
·62 lines (55 loc) · 1.57 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
#!/usr/bin/env bash
if [ -n "$1" ] ;then
export mainClass="$1"
shift
else
export mainClass="ExecutionPreview"
fi
# default timeout
hour=24
randomSeed=1
while getopts "t:p:s:" opt ; do
case $opt in
t)
export hour="$OPTARG"
;;
p)
export projectName="$OPTARG"
;;
s)
export randomSeed="$OPTARG"
;;
\?)
echo "Invalid option: -$OPTARG"
exit 1
;;
:)
echo "Option -$OPTARG requires an argument."
exit 1
;;
esac
done
# running elements
ProjectPath="."
ClassPath="${ProjectPath}/Jetris/*"
LibPath="${ProjectPath}/lib/*"
OpenJDK8Lib="/usr/lib/jvm/java-8-openjdk-amd64/lib/*:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/*"
ClassPaths="${ClassPath}:${LibPath}:${OpenJDK8Lib}"
ClassPaths=${ClassPaths// }
# setting timeout for experiments
timeout=$((3600*hour))
# create 03results folder for saving results
timeStamp=$(date +%s)
ResultRootPath="03results/$timeStamp"
mkdir -p "$ResultRootPath"
# log file path
logFile="${ResultRootPath}/output"
# running options
options=""
if [ -n "${projectName}" ]; then
options="${options} -p ${projectName}"
fi
echo "Executing command: timeout ${timeout} java -Xms10g -Xmx10g -ea -cp ${ClassPaths} ${mainClass} -t ${timeStamp} -s ${randomSeed} ${options} 2>&1 | tee ${logFile}.out ..."
timeout ${timeout} java -Xms10g -Xmx10g -ea -cp ${ClassPaths} ${mainClass} -t ${timeStamp} -s ${randomSeed} ${options} 2>&1 | tee ${logFile}.out
mv ./hs_err_* ./03results
mv ./javacore* ./03results