Headless mode for dummies
Overview​
This tutorial presents the headless mode usage of GAMA. We will execute the Predator-Prey model, already presented in this tutorial. Headless mode is documented in its dedicated part, here, we focus on the definition of an experiment plan, where the model is run several times. We only consider the shell script execution, not the java command execution.
In headless-mode, GAMA can be seen as any shell command, whose behavior is controlled by passing arguments to it. You must provide 2 arguments :
- an input experiment file, used to describe the execution plan of your model, its inputs and the expected outputs.
- an output directory, where the results of the execution are stored
Headless-mode is a little more technical to handle than the general GAMA use-case, and the following commands and code have been solely tested on a Linux Ubuntu 22.04 machine with the default GAMA 1.9.2 (installer version, with embedded JDK).
You may have to perform some adjustments (such as paths definition) according to your machine, OS, java and GAMA versions and so on.
Setup​
GAMA version​
Headless mode is frequently updated by GAMA developers, so you have to get the very latest build version of GAMA. You can download it here https://github.com/gama-platform/gama/releases Be sure to pick the Continuous build version (The name looks like GAMA1.7_Linux_64_02.26.17_da33f5b.zip
) and not the major release, e.g. GAMA1.7_Linux_64.zip
.
Big note on Windows OS (maybe on others), GAMA must be placed outside of several sensible folders (Program Files, Program Filesx64, Windows). RECOMMENDED: Place GAMA in Users Folder of windows OS.
gama-headless.sh script setup​
The gama-headless.sh
script can be found under the headless
directory, in GAMA installation directory e.g. : ~/GAMA/headless/