#!/bin/bash

# Headless Legacy mode.
#
# Command to generate a XML file corresponding to an existing experiment :
#. ./gama-headless.sh -xml experimentName /path/to/inputFile.gaml /path/to/outputFile.xml
# with:
# -  -xml: flag asking the headless to generate a XML file well-formatted
#    for our experiment.
# -  experimentName: name of the experiment to run in headless.
#    Important : experiment of 'type': 'gui'.
# -  /path/to/inputFile.gaml: path (relative or absolute) to GAML file
#    containing the experiment to run.
# -  /path/to/outputFile.xml: path (relative or absolute) to the
#    generated XML file.
#
# With :
# - GAMA application in folder ./software
# - GAML file (containing the experiment to run) path : ./inputs/model.gaml
# - Generated XML file path : ./outputs/file.xml

EXPERIMENT_NAME=$1
#EXPERIMENT_NAME="prey_predator"

HOME=$(echo $PWD)
cd /opt/gama-platform/headless;
/bin/bash MY_gama-headless.sh -xml ${EXPERIMENT_NAME} ${HOME}/inputs/model.gaml ${HOME}/outputs/file.xml
