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​
advanced_driving, dynamic_body, fipa, messaging, moving, moving3D, network, pedestrian, pedestrian_road, skill_road, skill_road_node, SQLSKILL, static_body, thread,
advanced_driving
​
Variables​
acc_bias
(float
): the bias term used for asymmetric lane changing, parameter 'a_bias' in MOBILacc_gain_threshold
(float
): the minimum acceleration gain for the vehicle to switch to another lane, introduced to prevent frantic lane changing. Known as the parameter 'a_th' in the MOBIL lane changing modelacceleration
(float
): the current acceleration of the vehicle (in m/s^2)allowed_lanes
(list
): a list containing possible lane index values for the attribute lowest_lanecurrent_index
(int
): the index of the current edge (road) in the pathcurrent_lane
(int
): the current lane on which the agent iscurrent_path
(path
): the path which the agent is currently followingcurrent_road
(agent
): the road which the vehicle is currently oncurrent_target
(agent
): the current target of the agentdelta_idm
(float
): the exponent used in the computation of free-road acceleration in the Intelligent Driver Modeldistance_to_current_target
(float
): euclidean distance to the current target nodedistance_to_goal
(float
): euclidean distance to the endpoint of the current segmentfinal_target
(agent
): the final target of the agentfollower
(agent
): the vehicle following this vehicleignore_oneway
(boolean
): if set totrue
, the vehicle will be able to violate one-way traffic rulelane_change_cooldown
(float
): the duration that a vehicle must wait before changing lanes againlane_change_limit
(int
): the maximum number of lanes that the vehicle can change during a simulation stepleading_distance
(float
): the distance to the leading vehicleleading_speed
(float
): the speed of the leading vehicleleading_vehicle
(agent
): the vehicle which is right ahead of the current vehicle. If this is set to nil, the leading vehicle does not exist or might be very far away.linked_lane_limit
(int
): the maximum number of linked lanes that the vehicle can use; the default value is -1, i.e. the vehicle can use all available linked laneslowest_lane
(int
): the lane with the smallest index that the vehicle is inmax_acceleration
(float
): the maximum acceleration of the vehicle. Known as the parameter 'a' in the Intelligent Driver Modelmax_deceleration
(float
): the maximum deceleration of the vehicle. Known as the parameter 'b' in the Intelligent Driver Modelmax_safe_deceleration
(float
): the maximum deceleration that the vehicle is willing to induce on its back vehicle when changing lanes. Known as the parameter 'b_save' in the MOBIL lane changing modelmax_speed
(float
): the maximum speed that the vehicle can achieve. Known as the parameter 'v0' in the Intelligent Driver Modelmin_safety_distance
(float
): the minimum distance of the vehicle's front bumper to the leading vehicle's rear bumper, known as the parameter s0 in the Intelligent Driver Modelmin_security_distance
(float
): the minimal distance to another vehiclenext_road
(agent
): the road which the vehicle will enter nextnum_lanes_occupied
(int
): the number of lanes that the vehicle occupieson_linked_road
(boolean
): is the agent on the linked road?politeness_factor
(float
): determines the politeness level of the vehicle when changing lanes. Known as the parameter 'p' in the MOBIL lane changing modelproba_block_node
(float
): probability to block a node (do not let other vehicle cross the crossroad), within one secondproba_lane_change_down
(float
): probability to change to a lower lane (right lane if right side driving) to gain acceleration, within one secondproba_lane_change_up
(float
): probability to change to a upper lane (left lane if right side driving) to gain acceleration, within one secondproba_respect_priorities
(float
): probability to respect priority (right or left) laws, within one secondproba_respect_stops
(list
): probability to respect stop laws - one value for each type of stop, within one secondproba_use_linked_road
(float
): probability to change to a linked lane to gain acceleration, within one secondreal_speed
(float
): the actual speed of the agent (in meter/second)right_side_driving
(boolean
): are vehicles driving on the right size of the road?safety_distance_coeff
(float
): the coefficient for the computation of the the min distance between two vehicles (according to the vehicle speed - security_distance =max(min_security_distance, security_distance_coeff*
min(self.real_speed, other.real_speed) )security_distance_coeff
(float
): the coefficient for the computation of the the min distance between two vehicles (according to the vehicle speed - safety_distance =max(min_safety_distance, safety_distance_coeff*
min(self.real_speed, other.real_speed) )segment_index_on_road
(int
): current segment index of the agent on the current roadspeed
(float
): the speed of the agent (in meter/second)speed_coeff
(float
): speed coefficient for the speed that the vehicle want to reach (according to the max speed of the road)targets
(list
): the current list of points that the agent has to reach (path)time_headway
(float
): the time gap that to the leading vehicle that the driver must maintain. Known as the parameter 'T' in the Intelligent Driver Modeltime_since_lane_change
(float
): the elapsed time since the last lane changeusing_linked_road
(boolean
): indicates if the vehicle is occupying at least one lane on the linked roadvehicle_length
(float
): the length of the vehicle (in meters)violating_oneway
(boolean
): indicates if the vehicle is moving in the wrong direction on an one-way (unlinked) road
Actions​
advanced_follow_driving
​
moves the agent towards along the path passed in the arguments while considering the other agents in the network (only for graph topology)
Returned type: float
: the remaining time
Additional facets:​
path
(path): a path to be followed.target
(point): the target to reachspeed
(float): the speed to use for this move (replaces the current value of speed)time
(float): time to travel
Examples:​
do osm_follow path: the_path on: road_network;
choose_lane
​
Override this if you want to manually choose a lane when entering new road. By default, the vehicle tries to stay in the current lane. If the new road has fewer lanes than the current one and the current lane index is too big, it tries to enter the most uppermost lane.
Returned type: int
: an integer representing the lane index
Additional facets:​
new_road
(agent): the new road that's the vehicle is going to enter
compute_path
​
Action to compute the shortest path to the target node, or shortest path based on the provided list of nodes
Returned type: path
: the computed path, or nil if no valid path is found
Additional facets:​
graph
(graph): the graph representing the road networktarget
(agent): the target node to reachsource
(agent): the source node (optional, if not defined, closest node to the agent location)nodes
(list): the nodes forming the resulting path
Examples:​
do compute_path graph: road_network target: target_node;
do compute_path graph: road_network nodes: [node1, node5, node10];
drive
​
action to drive toward the target
Returned type: bool
Examples:​
do drive;
drive_random
​
action to drive by chosen randomly the next road
Returned type: bool
Additional facets:​
graph
(graph): a graph representing the road networkproba_roads
(map): a map containing for each road (key), the probability to be selected as next road (value)
Examples:​
do drive_random init_node: some_node;
external_factor_impact
​
action that allows to define how the remaining time is impacted by external factor
Returned type: float
: the remaining time
Additional facets:​
new_road
(agent): the road on which to the vehicle wants to goremaining_time
(float): the remaining time
Examples:​
do external_factor_impact new_road: a_road remaining_time: 0.5;
force_move
​
action to drive by chosen randomly the next road
Returned type: float
Additional facets:​
lane
(int): the lane on which to make the agent moveacceleration
(float): acceleration of the vehicletime
(float): time of move
Examples:​
do drive_random init_node: some_node;
goto_drive
​
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 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)following
(path): Path to follow.
Examples:​
do goto_drive target: one_of road on: road_network;
lane_choice
​
action to choose a lane
Returned type: int
: the chosen lane, return -1 if no lane can be taken
Additional facets:​
new_road
(agent): the road on which to choose the lane
Examples:​
do lane_choice new_road: a_road;
on_entering_new_road
​
override this if you want to do something when the vehicle enters a new road (e.g. adjust parameters)
Returned type: void
path_from_nodes
​
action to compute a path from a list of nodes according to a given graph
Returned type: path
: the computed path, return nil if no path can be taken
Additional facets:​
graph
(graph): the graph representing the road networknodes
(list): the list of nodes composing the path
Examples:​
do compute_path_from_nodes graph: road_network nodes: [node1, node5, node10];
ready_to_cross
​
action to test if the vehicle cross a road node to move to a new road
Returned type: bool
: true if the vehicle can cross the road node, false otherwise
Additional facets:​
node
(agent): the road node to testnew_road
(agent): the road to test
Examples:​
do is_ready_next_road new_road: a_road lane: 0;
speed_choice
​
action to choose a speed
Returned type: float
: the chosen speed
Additional facets:​
new_road
(agent): the road on which to choose the speed
Examples:​
do speed_choice new_road: the_road;
test_next_road
​
action to test if the vehicle can take the given road
Returned type: bool
: true (the vehicle can take the road) or false (the vehicle cannot take the road)
Additional facets:​
new_road
(agent): the road to test
Examples:​
do test_next_road new_road: a_road;
unregister
​
remove the vehicle from its current roads
Returned type: bool
Examples:​
do unregister
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