Skip to content

BuiltInSpecies

GAMA Bot edited this page Jan 6, 2024 · 42 revisions

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 (agent): Returns the agent that hosts the population of the receiver agent
  • index (int): Returns the unique index of this agent in its population. Read-only attribute
  • 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

GUI experiments are experiments used to visualise and interact with simulations through the regular user interface of GAMA. They can declare, parameters, used to populate the Parameters view, outputs like displays or monitors

Variables

  • maximum_cycle_duration (float): The maximum duration (in seconds) a simulation cycle should last. Default is 1. Units can be used to pass values greater than a second (for instance '10 #sec')
  • 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. Four different ones are at the disposal of the modeler: 'mersenne' represents the default generator, based on the Mersenne-Twister algorithm. Very reliable, fast and deterministic (that is, using the same seed and the same sequence of calls, it will return the same stream of pseudo-random numbers). This algorithm is however not safe to use in simulations where agents can behave in parallel; 'threaded' is a very fast generator, based on the DotMix algorithm, that can be safely used in parallel simulations as it creates one instance per thread. However, determinism cannot be guaranteed and this algorithm does not accept a seed as each instance will compute its own;'parallel' is a version of the Mersenne-Twister algorithm that can be safely used in parallel simulations by preventing a concurrent access to its internal state. Determinism is guaranteed (in terms of generation, but not in terms of execution, as the sequence in which the threads will access it cannot be determined) and it performs a bit slower than its base version.'java' invokes the standard generator provided by the JDK, deterministic and thread-safe, albeit slower than all the other ones
  • 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 (agent): Contains a reference to the current simulation being run by this experiment
  • simulations (list): Contains the list of currently running simulations
  • 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

related_to

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 (field): 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
  1. What's new (Changelog)
  1. Installation and Launching
    1. Installation
    2. Launching GAMA
    3. Updating GAMA
    4. Installing Plugins
  2. Workspace, Projects and Models
    1. Navigating in the Workspace
    2. Changing Workspace
    3. Importing Models
  3. Editing Models
    1. GAML Editor (Generalities)
    2. GAML Editor Tools
    3. Validation of Models
  4. Running Experiments
    1. Launching Experiments
    2. Experiments User interface
    3. Controls of experiments
    4. Parameters view
    5. Inspectors and monitors
    6. Displays
    7. Batch Specific UI
    8. Errors View
  5. Running Headless
    1. Headless Batch
    2. Headless Server
    3. Headless Legacy
  6. Preferences
  7. Troubleshooting
  1. Introduction
    1. Start with GAML
    2. Organization of a Model
    3. Basic programming concepts in GAML
  2. Manipulate basic Species
  3. Global Species
    1. Regular Species
    2. Defining Actions and Behaviors
    3. Interaction between Agents
    4. Attaching Skills
    5. Inheritance
  4. Defining Advanced Species
    1. Grid Species
    2. Graph Species
    3. Mirror Species
    4. Multi-Level Architecture
  5. Defining GUI Experiment
    1. Defining Parameters
    2. Defining Displays Generalities
    3. Defining 3D Displays
    4. Defining Charts
    5. Defining Monitors and Inspectors
    6. Defining Export files
    7. Defining User Interaction
  6. Exploring Models
    1. Run Several Simulations
    2. Batch Experiments
    3. Exploration Methods
  7. Optimizing Model Section
    1. Runtime Concepts
    2. Optimizing Models
  8. Multi-Paradigm Modeling
    1. Control Architecture
    2. Defining Differential Equations
  1. Manipulate OSM Data
  2. Diffusion
  3. Using Database
  4. Using FIPA ACL
  5. Using BDI with BEN
  6. Using Driving Skill
  7. Manipulate dates
  8. Manipulate lights
  9. Using comodel
  10. Save and restore Simulations
  11. Using network
  12. Headless mode
  13. Using Headless
  14. Writing Unit Tests
  15. Ensure model's reproducibility
  16. Going further with extensions
    1. Calling R
    2. Using Graphical Editor
    3. Using Git from GAMA
  1. Built-in Species
  2. Built-in Skills
  3. Built-in Architecture
  4. Statements
  5. Data Type
  6. File Type
  7. Expressions
    1. Literals
    2. Units and Constants
    3. Pseudo Variables
    4. Variables And Attributes
    5. Operators [A-A]
    6. Operators [B-C]
    7. Operators [D-H]
    8. Operators [I-M]
    9. Operators [N-R]
    10. Operators [S-Z]
  8. Exhaustive list of GAMA Keywords
  1. Installing the GIT version
  2. Developing Extensions
    1. Developing Plugins
    2. Developing Skills
    3. Developing Statements
    4. Developing Operators
    5. Developing Types
    6. Developing Species
    7. Developing Control Architectures
    8. Index of annotations
  3. Introduction to GAMA Java API
    1. Architecture of GAMA
    2. IScope
  4. Using GAMA flags
  5. Creating a release of GAMA
  6. Documentation generation

  1. Predator Prey
  2. Road Traffic
  3. 3D Tutorial
  4. Incremental Model
  5. Luneray's flu
  6. BDI Agents

  1. Team
  2. Projects using GAMA
  3. Scientific References
  4. Training Sessions

Resources

  1. Videos
  2. Conferences
  3. Code Examples
  4. Pedagogical materials
Clone this wiki locally