Repository navigation
HeadlessLegacy
Arthur edited this page Jul 22, 2026
·
9 revisions
Headless Legacy mode uses XML experiment plan files to run multiple simulations. This is an older mode but still useful for simple scripted runs and legacy workflows.
For batch experiments defined directly in your .gaml model, use Headless Batch. For interactive remote control, use Headless Server.
Generate an XML experiment plan from a model:
gama-headless.sh -xml experimentName /path/to/model.gaml plan.xmlThen run it:
gama-headless.sh plan.xml /path/to/results/For a single experiment without XML:
gama-headless.sh -gaml -steps 1000 experimentName /path/to/model.gaml /path/to/results/<?xml version="1.0" encoding="UTF-8"?>
<Experiment_plan>
<Simulation experiment="expName" finalStep="1000" id="0" seed="42">
<source_path>/path/to/model.gaml</source_path>
<Parameters>
<Parameter name="Parameter Display Name" type="INT" value="10"/>
</Parameters>
<Outputs>
<Output name="Monitor Name" framerate="1"/>
</Outputs>
</Simulation>
</Experiment_plan>Multiple <Simulation> blocks can be added to run experiments in parallel (limited by the -hpc flag).
| Attribute | Required | Description |
|---|---|---|
experiment |
Yes | Name of the experiment in the GAML model |
finalStep |
Yes | Number of steps to run |
id |
Yes | ID to prefix output files |
seed |
No | Random seed value |
source_path |
Yes | Path to the .gaml model file |
until |
No | GAML stop condition (combinable with finalStep) |
| Attribute | Required | Description |
|---|---|---|
name |
Yes (if var not set) |
Display name as written in the GAML parameter statement |
var |
Yes (if name not set) |
Variable name in the GAML model |
type |
Yes | Data type: INT, FLOAT, BOOLEAN, STRING
|
value |
Yes | Value to assign |
Note: Set either
nameorvar, not both.
| Attribute | Required | Description |
|---|---|---|
name |
Yes | Name of a monitor, display, or global variable |
framerate |
Yes | Log frequency in steps |
id |
No | Prefix for output files (if multiple outputs share a name) |
Note: Lower framerate values → more data but longer execution time.
Results are saved to the output directory:
results/
├── console-outputs-0.txt # Console output
├── simulation-output0.xml # Variable values over time
└── snapshot/ # Display screenshots
└── displayName-0-N.png # Screen capture at step N
<?xml version="1.0" encoding="UTF-8"?>
<Simulation id="0">
<Step id='0'>
<Variable name='number_of_agents' value='50'/>
<Variable name='main_display' value='main_display0-0.png'/>
<Variable name='duration' value='4'/>
</Step>
</Simulation>Displays save screenshots as .png files; their path is stored in the XML.
import os
os.system(f"gama-headless.sh -xml exp /path/to/model.gaml plan.xml")
os.system(f"gama-headless.sh plan.xml /path/to/results/")const { exec } = require('child_process');
exec('gama-headless.sh -xml exp /path/to/model.gaml plan.xml', (err) => {
exec('gama-headless.sh plan.xml /path/to/results/', (err) => {});
});| Error | Cause | Solution |
|---|---|---|
No parameter named X in experiment Y |
Typo in parameter name or variable name | Check spaces, capitalization, and exact wording |
Model file does not exist |
Incorrect model path | Use absolute paths, or verify relative paths from XML location |
NumberFormatException |
Type mismatch in XML | Ensure type matches value (INT vs FLOAT) |
NoClassDefFoundError / resourcesResourcesPlugin
|
No write permission | Run from a writable directory (not Program Files on Windows) |
- Installation and Launching
- Workspace, Projects and Models
- Editing Models
- Running Experiments
- Running Headless
- Exporting Projects As Simulation Launchers
- Preferences
- Troubleshooting
- Introduction
- Manipulate basic Species
- Global Species
- Defining Advanced Species
- Defining GUI Experiment
- Classes and Objects
- Exploring Models
- Optimizing Models
- Multi-Paradigm Modeling
- Manipulate OSM Data
- Cleaning OSM Data
- Diffusion
- Using Database
- Using Dataframes
- Using FIPA ACL
- Using BDI with BEN
- Using Driving Skill
- Manipulate dates
- Manipulate lights
- Using comodel
- Save and restore Simulations
- Using network
- Writing Unit Tests
- Ensure model's reproducibility
- Going further with extensions
- Built-in Species
- Built-in Skills
- Built-in Architecture
- Statements
- Data Type
- File Type
- Stats Extension
- Sound Extension
- BDI Extension
- FIPA Skill
- Expressions
- Exhaustive list of GAMA Keywords
- Installing the development version
- Developing Extensions
- Introduction to GAMA Java API
- Using GAMA flags
- Export plugin : Technical Documentation
- Creating a release of GAMA
- Documentation generation
- Predator Prey
- Road Traffic
- Incremental Model
- Luneray's flu
- BDI Agents
- Forager RL
- SIR Analysis
- 3D Model