# Starts the rddlsim server, which is available as a svn repository at
# https://rddlsim.googlecode.com/svn. Must be downloaded and compiled, and the
# lib and bin directories must be copied to testbed/rddlsim for this script to
# work. If you have any questions on rddlsim, please contact Scott Sanner
# (ssanner [@] gmail.com)

Home=rddlsim
libDir=${Home}/lib
CP=${Home}/bin
CYGWIN_SEP=";"
UNIX_SEP=":"

# Choose separator as appropriate for shell system (Cygwin, otherwise UNIX)
SEP=":" 
if [[ $OSTYPE == "cygwin" ]] ; then
    SEP=";" 
fi

for i in ${libDir}/*.jar ; do
    CP="${CP}${SEP}$i"
done
# arg1: benchmark directory (required input)
# arg2: portnumber
# arg3: number of rounds
# arg4: random seed
# arg5: use timeout (0/1 for false/true)
# arg6: individual session (0/1 for false/true)
# arg7: log folder
# arg8: monitor execution (0/1 for false/true)
# arg9: class name for visualization display (i.e., rddlsim screen display class)
if [ $# == 0 ] ; then
   java -Xms100M -Xmx500M -classpath $CP rddl.competition.Server benchmarks/ippc-all 2323 30 0 0 0
else
   java -Xms100M -Xmx500M -classpath $CP rddl.competition.Server $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10}
fi
