#!/bin/sh

if [ -z $JAVA_HOME ] ; then
	JAVA_HOME=/usr/lib/java
fi

if [ -z $SWING_HOME ] ; then
	SWING_HOME=/usr/lib/swing
fi

if [ -z $JCHR_HOME ] ; then
	JCHR_HOME=/home/proj/chr/jchr
fi

if [ -z $VCHR_HOME ] ; then
	VCHR_HOME=/home/proj/chr/vchr
fi

JAVA_CLASSES=$JAVA_HOME/lib/classes.zip
SWING_CLASSES=$SWING_HOME/swingall.jar
VJCHR_CLASSES=$JCHR_HOME/evaluator.jar:$VCHR_HOME/VisualCHR.jar
SOLVER_CLASSES=.
if [ $@ ] ; then
	SOLVER_CLASSES=$@
fi

CLASSPATH=$JAVA_CLASSES:$SWING_CLASSES:$VJCHR_CLASSES:$SOLVER_CLASSES

###
### PARAMETER DESCRIPTIONS 
### (or "hidden features")
###
#
## param:  -SHOW_CLONED
## values: "true" or "false" 
## descr:  set true, if cloned nodes should be shown  
##         (undocumented, defaults to false) 
#
## param:  -SHOW_FAILER
## values: "true" or "false" 
## descr:  set true, if failer nodes should be shown  
##         (undocumented, defaults to false) 
#
## param:  -SELECTION_ENABLED
## values: "true" or "false" 
## descr:  set true, if explicite application of rules should be allowed 
##         (undocumented, not implemented yet in JCHR, defaults to false) 
#
## param:  -SKIP_SLEEP
## descr:  milliseconds between skip steps  
##         (should be big enough to repaint screen, defaults to 250) 
#
## param:  -COLOR_SCHEME
## values: "visualchr" or "system" 
## descr:  set the color scheme, either "system" or "visualchr"  
##         (system are system colors, defaults to system) 
#

PARAMS=\
" \
-SHOW_CLONED false \
-SHOW_FAILER false \
-SELECTION_ENABLED false \
-SKIP_SLEEP 250 \
-COLOR_SCHEME system \
"

$JAVA_HOME/bin/java -classpath $CLASSPATH visualchr.VisualCHR $PARAMS

