Built-in Skills
This file is automatically generated from java files. Do Not Edit It.
Introduction​
Skills are built-in modules, written in Java, that provide a set of related built-in variables and built-in actions (in addition to those already provided by GAMA) to the species that declare them. A declaration of skill is done by filling the skills attribute in the species definition:
species my_species skills: [skill1, skill2] {
...
}
Skills have been designed to be mutually compatible so that any combination of them will result in a functional species. An example of skill is the moving skill.
So, for instance, if a species is declared as:
species foo skills: [moving]{
...
}
Its agents will automatically be provided with the following variables : speed, heading, destination and the following actions: move, goto, wander, follow in addition to those built-in in species and declared by the modeller. Most of these variables, except the ones marked read-only, can be customized and modified like normal variables by the modeller. For instance, one could want to set a maximum for the speed; this would be done by redeclaring it like this:
float speed max:100 min:0;
Or, to obtain a speed increasing at each simulation step:
float speed max:100 min:0 <- 1 update: speed * 1.01;
Or, to change the speed in a behavior:
if speed = 5 {
speed <- 10;
}
Table of Contents​
dynamic_body, fipa, intersection_skill, messaging, moving, moving3D, network, pedestrian, pedestrian_road, road_skill, SQLSKILL, static_body, thread,
dynamic_body​
Variables​
angular_damping(float): Between 0 and 1. an angular decelaration coefficient that occurs even without contactangular_velocity(point): The angular velocity of the agent in the three directions, expressed as a point.contact_damping(float): Between 0 and 1. a decelaration coefficient that occurs in case of contact. Only available in the native Bullet library (no effect on the Java implementation)damping(float): Between 0 and 1. a linear decelaration coefficient that occurs even without contactvelocity(point): The linear velocity of the agent in the three directions, expressed as a point.
Actions​
apply​
An action that allows to apply different effects to the object, like forces, impulses, etc.
Returned type: unknown
Additional facets:​
clearance(boolean): If true clears all forces applied to the agent and clears its veolicity as wellimpulse(point): An idealised change of momentum. Adds to the velocity of the object. This is the kind of push that you would use on a pool billiard ball.force(point): Move (push) the object once with a certain moment, expressed as a point (vector). Adds to the existing forces.torque(point): Rotate (twist) the object once around its axes, expressed as a point (vector)
fipa​
The fipa skill offers some primitives and built-in variables which enable agent to communicate with each other using the FIPA interaction protocol.
Variables​
accept_proposals(list): A list of 'accept_proposal' performative messages in the agent's mailboxagrees(list): A list of 'agree' performative messages.cancels(list): A list of 'cancel' performative messages.cfps(list): A list of 'cfp' (call for proposal) performative messages.conversations(list): A list containing the current conversations of agent. Ended conversations are automatically removed from this list.failures(list): A list of 'failure' performative messages.informs(list): A list of 'inform' performative messages.proposes(list): A list of 'propose' performative messages .queries(list): A list of 'query' performative messages.refuses(list): A list of 'propose' performative messages.reject_proposals(list): A list of 'reject_proposal' performative messages.requests(list): A list of 'request' performative messages.requestWhens(list): A list of 'request-when' performative messages.subscribes(list): A list of 'subscribe' performative messages.
Actions​
accept_proposal​
Replies a message with an 'accept_proposal' performative message.
Returned type: unknown
Additional facets:​
message(message): The message to be repliedcontents(list): The content of the replying message
agree​
Replies a message with an 'agree' performative message.
Returned type: unknown
Additional facets:​
message(message): The message to be repliedcontents(list): The content of the replying message
cancel​
Replies a message with a 'cancel' peformative message.
Returned type: unknown
Additional facets:​
message(message): The message to be repliedcontents(list): The content of the replying message
cfp​
Replies a message with a 'cfp' performative message.
Returned type: unknown
Additional facets:​
message(message): The message to be repliedcontents(list): The content of the replying message
end_conversation​
Reply a message with an 'end_conversation' peprformative message. This message marks the end of a conversation. In a 'no-protocol' conversation, it is the responsible of the modeler to explicitly send this message to mark the end of a conversation/interaction protocol. Please note that if the contents of the messages of the conversation are not read, then this command has no effect (i.e. it must be read by at least one of the agents in the conversation)
Returned type: unknown
Additional facets:​
message(message): The message to be repliedcontents(list): The content of the replying message
failure​
Replies a message with a 'failure' performative message.
Returned type: unknown
Additional facets:​
message(message): The message to be repliedcontents(list): The content of the replying message
inform​
Replies a message with an 'inform' performative message.
Returned type: unknown
Additional facets:​
message(message): The message to be repliedcontents(list): The content of the replying message
propose​
Replies a message with a 'propose' performative message.
Returned type: unknown
Additional facets:​
message(message): The message to be repliedcontents(list): The content of the replying message
query​
Replies a message with a 'query' performative message.
Returned type: unknown
Additional facets:​
message(message): The message to be repliedcontents(list): The content of the replying message
refuse​
Replies a message with a 'refuse' performative message.
Returned type: unknown
Additional facets:​
message(message): The message to be repliedcontents(list): The contents of the replying message
reject_proposal​
Replies a message with a 'reject_proposal' performative message.
Returned type: unknown
Additional facets:​
message(message): The message to be repliedcontents(list): The content of the replying message
reply​
Replies a message. This action should be only used to reply a message in a 'no-protocol' conversation and with a 'user defined performative'. For performatives supported by GAMA (i.e., standard FIPA performatives), please use the 'action' with the same name of 'performative'. For example, to reply a message with a 'request' performative message, the modeller should use the 'request' action.
Returned type: unknown
Additional facets:​
message(message): The message to be repliedperformative(string): The performative of the replying messagecontents(list): The content of the replying message
request​
Replies a message with a 'request' performative message.
Returned type: unknown
Additional facets:​
message(message): The message to be repliedcontents(list): The content of the replying message
start_conversation​
Starts a conversation/interaction protocol.
Returned type: message
Additional facets:​
to(list): A list of receiver agentscontents(list): The content of the message. A list of any GAML typeperformative(string): A string, representing the message performativeprotocol(string): A string representing the name of interaction protocol
subscribe​
Replies a message with a 'subscribe' performative message.
Returned type: unknown
Additional facets:​
message(message): The message to be repliedcontents(list): The content of the replying message
intersection_skill​
Variables​
block(map): define the list of agents blocking the node, and for each agent, the list of concerned roadspriority_roads(list): the list of priority roadsroads_in(list): the list of input roadsroads_out(list): the list of output roadsstop(list): define for each type of stop, the list of concerned roads
Actions​
messaging​
A simple skill that provides agents with a mailbox than can be filled with messages
Variables​
mailbox(list): The list of messages that can be consulted by the agent
Actions​
send​
Action used to send a message (that can be of any kind of object) to an agent or a server.
Returned type: message
Additional facets:​
to(any type): The agent, or server, to which this message will be sent tocontents(any type): The contents of the message, an arbitrary object
Examples:​
do send to:dest contents:"This message is sent by " + name + " to " + dest;
moving​
The moving skill is intended to define the minimal set of behaviours required for agents that are able to move on different topologies
Variables​
current_edge(geometry): Represents the agent/geometry on which the agent is located (only used with a graph)current_path(path): Represents the path on which the agent is moving on (goto action on a graph)heading(float): Represents the absolute heading of the agent in degrees.location(point): Represents the current position of the agentreal_speed(float): Represents the actual speed of the agent (in meter/second)speed(float): Represents the speed of the agent (in meter/second)
Actions​
follow​
moves the agent along a given path passed in the arguments.
Returned type: path : optional: the path followed by the agent.
Additional facets:​
speed(float): the speed to use for this move (replaces the current value of speed)path(path): a path to be followed.move_weights(map): Weights used for the moving.return_path(boolean): if true, return the path followed (by default: false)
Examples:​
do follow speed: speed * 2 path: road_path;
goto​
moves the agent towards the target passed in the arguments.
Returned type: path : optional: the path followed by the agent.
Additional facets:​
target(geometry): the location or entity towards which to move.speed(float): the speed to use for this move (replaces the current value of speed)on(any type): graph, topology, list of geometries or map of geometries that restrain this moverecompute_path(boolean): if false, the path is not recompute even if the graph is modified (by default: true)return_path(boolean): if true, return the path followed (by default: false)move_weights(map): Weights used for the moving.
Examples:​
do goto target: (one_of road).location speed: speed * 2 on: road_network;
move​
moves the agent forward, the distance being computed with respect to its speed and heading. The value of the corresponding variables are used unless arguments are passed.
Returned type: path
Additional facets:​
speed(float): the speed to use for this move (replaces the current value of speed)heading(float): the angle (in degree) of the target direction.bounds(geometry): the geometry (the localized entity geometry) that restrains this move (the agent moves inside this geometry
Examples:​
do move speed: speed - 10 heading: heading + rnd (30) bounds: agentA;
wander​
Moves the agent towards a random location at the maximum distance (with respect to its speed). The heading of the agent is chosen randomly if no amplitude is specified. This action changes the value of heading.
Returned type: bool
Additional facets:​
speed(float): the speed to use for this move (replaces the current value of speed)amplitude(float): a restriction placed on the random heading choice. The new heading is chosen in the range (heading - amplitude/2, heading+amplitude/2)bounds(geometry): the geometry (the localized entity geometry) that restrains this move (the agent moves inside this geometry)on(graph): the graph that restrains this move (the agent moves on the graphproba_edges(map): When the agent moves on a graph, the probability to choose another edge. If not defined, each edge has the same probability to be chosen
Examples:​
do wander speed: speed - 10 amplitude: 120 bounds: agentA;
moving3D​
The moving skill 3D is intended to define the minimal set of behaviours required for agents that are able to move on different topologies