13. The multi-agent GAML bridge
The GamaParallelEnv wrapper reads the PetzAgent species from the GAMA model. Its fields and returned data keys are visible in the Python client wrapper and the shipped Prison Escape controller. The package README at that revision instead describes GamaMultiAgent with different names and keys, so this page follows the wrapper and controller rather than the README example.
Define the bridge species​
The wrapper reads the active and possible agent identifiers, per-agent spaces, observations and infos; it writes actions and reads the data map after each GAMA step. The controller example publishes observations, rewards, terminations, truncations and infos under these exact keys:
species PetzAgent {
list<string> agents;
list<string> possible_agents;
map<string, unknown> observation_spaces;
map<string, unknown> action_spaces;
map<string, unknown> observations;
map<string, float> rewards;
map<string, bool> terminations;
map<string, bool> truncations;
map<string, map<string, unknown>> infos;
map<string, unknown> actions;
map<string, map<string, unknown>> data;
action update_data {
data <- [
"Observations"::observations,
"Rewards"::rewards,
"Terminations"::terminations,
"Truncations"::truncations,
"Infos"::infos
];
}
}
possible_agents identifies every agent for which the model provides spaces; agents contains those currently active in the episode. Define both space maps with one entry per possible agent. Each descriptor must be supported by the package's Gymnasium space converter and must match the values the model sends and accepts. The shipped controller shows a complete model-specific example of their initialization and update. This species declaration describes the package interface; it is not a complete Forager simulation. The Forager bridge, scheduling and reward logic still need joint validation.