Model structure
In GAML, a model is an GAML file (or set of files, included in each other) that consist(s) of a number of sections, among them three are mandatory:
global {
The definition of the structure and behaviors of the world.
This is where global data, parameters and dynamics are declared.
}
environment {
The definition of the environments that compose the world.
Some of them (like grids) define species of environmental agents.
}
entities {
The definition of the species of agents that populate the environments.
}In addition, GAMA needs to know how to simulate the model and what kind of information are to be extracted from it. Two more sections are then necessary:
output {
Which specifies the desired outputs of a simulation (graphical displays, charts, files, etc.).
}
batch { (optional)
Which can be added to describe the experimental protocols to use for simulating the model.
}Species structure
The major entities of a model (the world, the agents, some environments) are described in the form of species. Species are composed of:
- variables and specific declarations: define what their agents know.
- actions: define what their agents can do.
- behaviors: define what they actually do.
Species can inherit from other species their variables, actions and behaviors. They can also be defined to make use of:
- skills: built-in modules that pack together related variables and actions and make them available to the agents.
- controls: built-in modules that offer alternative ways to describe behaviors (like finite state machines, for instance).
GAML Language
- Actions (except built-in actions) and behaviors are written as sequences of commands.
- Commands use expressions to define conditions, data changes, computations, etc.
- An expression is composed of variables, keywords and operators.
- Every expression (and, therefore, every variable) has a type: either a built-in type or a species, as species can be seen as extended data types.
- Species come preloaded with built-in variables and skills variables (and every species can make use of the global built-in variables). All these variables can be redefined in GAML and, of course, new variables can be declared.