Repository navigation
InteractiveConsole
GAMA ships a view called Interactive console, recognisable to its gaml> prompt. It evaluates GAML expressions and statements directly, which is useful to test an operator, check a value, or look up the documentation of a keyword without leaving the editor.

The view is available from Views > Show View.... When it is attached to a running experiment, it prints a first line naming that experiment (Interacting with simulation Simulation 0); without any experiment it interacts with the platform itself (Interacting with platform gama). The view does not print the reminder of its three inputs (an expression to evaluate, ?keyword to look up documentation, and the arrow keys to browse the history): it is given as a tooltip on the prompt line, and in the Console help entry of the menu of the view.
Type an expression after the prompt and press Enter. The expression is evaluated in the context of the experiment that is currently running, and the result is printed below the prompt:
gaml> 1 + 2 * 3
7
The computation is performed by the platform, with access to the agents, the species and the global variables of the model, as if the expression had been written in the model itself. When no experiment is running, the console says so and evaluates nothing:
gaml> 1 + 2 * 3
> No active experiment. Start an experiment before evaluating a command.
The ?keyword form keeps working in that situation: the documentation is read from the compiler, not from a running agent.
Prefixing a keyword with ? prints the documentation of the corresponding operator, statement, skill or facet, together with its signature and the type of the value it returns:
gaml> ?distance_to
|| Operators ||
== operator distance_to(point p, point p), returns float
An Euclidean distance between two points.
== operator distance_to(geometry g, geometry g), returns float
A distance between two geometries (geometries, agents or points) considering the topology of
the agent applying the operator. Returns 0.0 if the two geometries are equal or at the same location.
This is the quickest way to check the exact signature of an operator. The same keywords are listed, with links to their documentation, in the exhaustive list of GAMA keywords.
The up and down arrow keys walk through the expressions already entered, so that a command can be recalled and modified rather than retyped.
- Installation and Launching
- Workspace, Projects and Models
- Editing Models
- Running Experiments
- Running Headless
- Exporting models and projects
- Preferences
- gama platform agent
- 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
- Introduction to GAMA Java API
- Developing Extensions
- Using GAMA flags
- Export plugin : Technical Documentation
- Creating a release of GAMA
- Documentation generation
- Desktop startup and deferred initialization