Skip to main content
Version: 1.8.2-RC2

Built-in Species


This file is automatically generated from java files. Do Not Edit It.


It is possible to use in the models a set of built-in agents. These agents allow to directly use some advance features like clustering, multi-criteria analysis, etc. The creation of these agents are similar as for other kinds of agents:

create species: my_built_in_agent returns: the_agent;

So, for instance, to be able to use clustering techniques in the model:

create cluster_builder returns: clusterer;

Table of Contents​

agent, AgentDB, base_edge, experiment, graph_edge, graph_node, physical_world,


agent​

Variables​

  • host (-29): Returns the agent that hosts the population of the receiver agent
  • location (point): Returns the location of the agent
  • name (string): Returns the name of the agent (not necessarily unique in its population)
  • peers (list): Returns the population of agents of the same species, in the same host, minus the receiver agent
  • shape (geometry): Returns the shape of the receiver agent

Actions​

_init_​


Returned type: unknown

_step_​


Returned type: unknown


AgentDB​

AgentDB is an abstract species that can be extended to provide agents with capabilities to access databases

Variables​

  • agents (list): Returns the list of agents for the population(s) of which the receiver agent is a direct or undirect host
  • members (container): Returns the list of agents for the population(s) of which the receiver agent is a direct host

Actions​

close​

Close the established database connection.

Returned type: unknown : Returns null if the connection was successfully closed, otherwise, it returns an error.

connect​

Establish a database connection.

Returned type: unknown : Returns null if connection to the server was successfully established, otherwise, it returns an error.

Additional facets:​
  • params (map): Connection parameters

executeUpdate​

- Make a connection to DBMS - Executes the SQL statement in this PreparedStatement object, which must be an SQL INSERT, UPDATE or DELETE statement; or an SQL statement that returns nothing, such as a DDL statement.

Returned type: int : Returns the number of updated rows.

Additional facets:​
  • updateComm (string): SQL commands such as Create, Update, Delete, Drop with question mark
  • values (list): List of values that are used to replace question mark

getParameter​

Returns the list used parameters to make a connection to DBMS (dbtype, url, port, database, user and passwd).

Returned type: unknown : Returns the list of used parameters to make a connection to DBMS.

insert​

- Make a connection to DBMS - Executes the insert statement.

Returned type: int : Returns the number of updated rows.

Additional facets:​
  • into (string): Table name
  • columns (list): List of column name of table
  • values (list): List of values that are used to insert into table. Columns and values must have same size

isConnected​

To check if connection to the server was successfully established or not.

Returned type: bool : Returns true if connection to the server was successfully established, otherwise, it returns false.

select​

Make a connection to DBMS and execute the select statement.

Returned type: list : Returns the obtained result from executing the select statement.

Additional facets:​
  • select (string): select string
  • values (list): List of values that are used to replace question marks

setParameter​

Sets the parameters to use in order to make a connection to the DBMS (dbtype, url, port, database, user and passwd).

Returned type: unknown : null.

Additional facets:​
  • params (map): Connection parameters

testConnection​

To test a database connection .

Returned type: bool : Returns true if connection to the server was successfully established, otherwise, it returns false.

Additional facets:​
  • params (map): Connection parameters

timeStamp​

Get the current time of the system.

Returned type: float : Current time of the system in millisecondes


base_edge​

A built-in species for agents representing the edges of a graph, from which one can inherit

Variables​

  • source (agent): The source agent of this edge
  • target (agent): The target agent of this edge

Actions​


experiment​

An experiment is a declaration of the way to conduct simulations on a model. Any experiment attached to a model is a species (introduced by the keyword 'experiment' which directly or indirectly inherits from an abstract species called 'experiment' itself. This abstract species (sub-species of 'agent') defines several attributes and actions that can then be used in any experiment. 'experiment' defines several attributes, which, in addition to the attributes inherited from agent, form the minimal set of knowledge any experiment will have access to.

Variables​

  • minimum_cycle_duration (float): The minimum duration (in seconds) a simulation cycle should last. Default is 0. Units can be used to pass values smaller than a second (for instance '10 °msec')
  • model_path (string): Contains the absolute path to the folder in which the current model is located
  • parameters (map): A parameters set of this experiment agent
  • project_path (string): Contains the absolute path to the project in which the current model is located
  • rng (string): The random number generator to use for this simulation. Three different ones are at the disposal of the modeler: mersenne represents the default generator, based on the Mersenne-Twister algorithm. Very reliable; cellular is a cellular automaton based generator that should be a bit faster, but less reliable; and java invokes the standard Java generator
  • rng_usage (int): Returns the number of times the random number generator of the experiment has been drawn
  • seed (float): The seed of the random number generator. Each time it is set, the random number generator is reinitialized. WARNING: Setting it to zero actually means that you let GAMA choose a random seed
  • simulation (-27): Contains a reference to the current simulation being run by this experiment
  • simulations (list): Contains the list of currently running simulations
  • warnings (boolean): The value of the preference 'Consider warnings as errors'
  • workspace_path (string): Contains the absolute path to the workspace of GAMA

Actions​

compact_memory​

Forces a 'garbage collect' of the unused objects in GAMA

Returned type: unknown

update_outputs​

Forces all outputs to refresh, optionally recomputing their values

Returned type: unknown

Additional facets:​
  • recompute (boolean): Whether or not to force the outputs to make a computation step

graph_edge​

A species that represents an edge of a graph made of agents. The source and the target of the edge should be agents

Variables​

  • source (agent): The source agent of this edge
  • target (agent): The target agent of this edge

Actions​


graph_node​

A base species to use as a parent for species representing agents that are nodes of a graph

Variables​

  • my_graph (graph): A reference to the graph containing the agent

Actions​

This operator should never be called

Returned type: bool

Additional facets:​
  • other (agent): The other agent

physical_world​

The base species for models that act as a 3D physical world. Can register and manage agents provided with either the 'static_body' or 'dynamic_body' skill. Inherits from 'static_body', so it can also act as a physical body itself (with a 'mass', 'friction', 'gravity'), of course without motion -- in this case, it needs to register itself as a physical agent using the 'register' action

Variables​

  • accurate_collision_detection (boolean): Enables or not a better (but slower) collision detection
  • automated_registration (boolean): If set to true (the default), makes the world automatically register and unregister agents provided with either the 'static_body' or 'dynamic_body' skill. Otherwise, they must be registered using the 'register' action, which can be useful when only some agents need to be considered as 'physical agents'. Note that, in any case, the world needs to manually register itself if it is supposed to act as a physical body.
  • gravity (point): Defines the value of gravity in this world. The default value is set to -9.80665 on the z-axis, that is 9.80665 m/s2 towards the 'bottom' of the world. Can be set to any direction and intensity and applies to all the bodies present in the physical world
  • library (string): This attribute allows to manually switch between two physics library, named 'bullet' and 'box2D'. The Bullet library, which comes in two flavors (see 'use_native') and the Box2D libray in its Java version (https://github.com/jbox2d/jbox2d). Bullet is the default library but models in 2D should better use Box2D
  • max_substeps (int): If equal to 0 (the default), makes the simulation engine be stepped alongside the simulation (no substeps allowed). Otherwise, sets the maximum number of physical simulation substeps that may occur within one GAMA simulation step
  • terrain (31): This attribute is a matrix of float that can be used to represent a 3D terrain. The shape of the world, in that case, should be a box, where thedimension on the z-axis is used to scale the z-values of the DEM. The world needs to be register itself as a physical object
  • use_native (boolean): This attribute allows to manually switch between the Java version of the Bullet library (JBullet, a modified version of https://github.com/stephengold/jbullet, which corresponds to version 2.72 of the original library) and the native Bullet library (Libbulletjme, https://github.com/stephengold/Libbulletjme, which is kept up-to-date with the 3.x branch of the original library).The native version is the default one unless the libraries cannot be loaded, making JBullet the default

Actions​

register​

An action that allows to register agents in this physical world. Unregistered agents will not be governed by the physical laws of this world. If the world is to play a role in the physical world,then it needs to register itself (i.e. do register([self]);

Returned type: unknown

Additional facets:​
  • bodies (container): the list or container of agents to register in this physical world