Operators (A to A)
This file is automatically generated from java files. Do Not Edit It.
Definition​
Operators in the GAML language are used to compose complex expressions. An operator performs a function on one, two, or n operands (which are other expressions and thus may be themselves composed of operators) and returns the result of this function.
Most of them use a classical prefixed functional syntax (i.e. operator_name(operand1, operand2, operand3)
, see below), with the exception of arithmetic (e.g. +
, /
), logical (and
, or
), comparison (e.g. >
, <
), access (.
, [..]
) and pair (::
) operators, which require an infixed notation (i.e. operand1 operator_symbol operand1
).
The ternary functional if-else operator, ? :
, uses a special infixed syntax composed with two symbols (e.g. operand1 ? operand2 : operand3
). Two unary operators (-
and !
) use a traditional prefixed syntax that does not require parentheses unless the operand is itself a complex expression (e.g. - 10
, ! (operand1 or operand2)
).
Finally, special constructor operators ({...}
for constructing points, [...]
for constructing lists and maps) will require their operands to be placed between their two symbols (e.g. {1,2,3}
, [operand1, operand2, ..., operandn]
or [key1::value1, key2::value2... keyn::valuen]
).
With the exception of these special cases above, the following rules apply to the syntax of operators:
- if they only have one operand, the functional prefixed syntax is mandatory (e.g.
operator_name(operand1)
) - if they have two arguments, either the functional prefixed syntax (e.g.
operator_name(operand1, operand2)
) or the infixed syntax (e.g.operand1 operator_name operand2
) can be used. - if they have more than two arguments, either the functional prefixed syntax (e.g.
operator_name(operand1, operand2, ..., operand)
) or a special infixed syntax with the first operand on the left-hand side of the operator name (e.g.operand1 operator_name(operand2, ..., operand)
) can be used.
All of these alternative syntaxes are completely equivalent.
Operators in GAML are purely functional, i.e. they are guaranteed to not have any side effects on their operands. For instance, the shuffle
operator, which randomizes the positions of elements in a list, does not modify its list operand but returns a new shuffled list.
Priority between operators​
The priority of operators determines, in the case of complex expressions composed of several operators, which one(s) will be evaluated first.
GAML follows in general the traditional priorities attributed to arithmetic, boolean, comparison operators, with some twists. Namely:
- the constructor operators, like
::
, used to compose pairs of operands, have the lowest priority of all operators (e.g.a > b :: b > c
will return a pair of boolean values, which means that the two comparisons are evaluated before the operator applies. Similarly,[a > 10, b > 5]
will return a list of boolean values. - it is followed by the
?:
operator, the functional if-else (e.g.a > b ? a + 10 : a - 10
will return the result of the if-else). - next are the logical operators,
and
andor
(e.g.a > b or b > c
will return the value of the test) - next are the comparison operators (i.e.
>
,<
,<=
,>=
,=
,!=
) - next the arithmetic operators in their logical order (multiplicative operators have a higher priority than additive operators)
- next the unary operators
-
and!
- next the access operators
.
and[]
(e.g.{1,2,3}.x > 20 + {4,5,6}.y
will return the result of the comparison between the x and y ordinates of the two points) - and finally the functional operators, which have the highest priority of all.
Using actions as operators​
Actions defined in species can be used as operators, provided they are called on the correct agent. The syntax is that of normal functional operators, but the agent that will perform the action must be added as the first operand.
For instance, if the following species is defined:
species spec1 {
int min(int x, int y) {
return x > y ? x : y;
}
}
Any agent instance of spec1 can use min
as an operator (if the action conflicts with an existing operator, a warning will be emitted). For instance, in the same model, the following line is perfectly acceptable:
global {
init {
create spec1;
spec1 my_agent <- spec1[0];
int the_min <- my_agent min(10,20); // or min(my_agent, 10, 20);
}
}
If the action doesn't have any operands, the syntax to use is my_agent the_action()
. Finally, if it does not return a value, it might still be used but is considering as returning a value of type unknown
(e.g. unknown result <- my_agent the_action(op1, op2);
).
Note that due to the fact that actions are written by modelers, the general functional contract is not respected in that case: actions might perfectly have side effects on their operands (including the agent).
Table of Contents​
Operators by categories​
3D​
box, cone3D, cube, cylinder, hexagon, pyramid, set_z, sphere, teapot,
Arithmetic operators​
-, /, ^, *, +, abs, acos, asin, atan, atan2, ceil, cos, cos_rad, div, even, exp, fact, floor, hypot, is_finite, is_number, ln, log, mod, round, signum, sin, sin_rad, sqrt, tan, tan_rad, tanh, with_precision,
BDI​
add_values, and, eval_when, get_about, get_agent, get_agent_cause, get_belief_op, get_belief_with_name_op, get_beliefs_op, get_beliefs_with_name_op, get_current_intention_op, get_decay, get_desire_op, get_desire_with_name_op, get_desires_op, get_desires_with_name_op, get_dominance, get_familiarity, get_ideal_op, get_ideal_with_name_op, get_ideals_op, get_ideals_with_name_op, get_intensity, get_intention_op, get_intention_with_name_op, get_intentions_op, get_intentions_with_name_op, get_lifetime, get_liking, get_modality, get_obligation_op, get_obligation_with_name_op, get_obligations_op, get_obligations_with_name_op, get_plan_name, get_predicate, get_solidarity, get_strength, get_super_intention, get_trust, get_truth, get_uncertainties_op, get_uncertainties_with_name_op, get_uncertainty_op, get_uncertainty_with_name_op, get_values, has_belief_op, has_belief_with_name_op, has_desire_op, has_desire_with_name_op, has_ideal_op, has_ideal_with_name_op, has_intention_op, has_intention_with_name_op, has_obligation_op, has_obligation_with_name_op, has_uncertainty_op, has_uncertainty_with_name_op, new_emotion, new_mental_state, new_predicate, new_social_link, not, or, set_about, set_agent, set_agent_cause, set_decay, set_dominance, set_familiarity, set_intensity, set_lifetime, set_liking, set_modality, set_predicate, set_solidarity, set_strength, set_trust, set_truth, with_values,
Casting operators​
as, as_int, as_matrix, font, is, is_skill, list_with, matrix_with, species, to_gaml, topology,
Color-related operators​
-, /, *, +, blend, brewer_colors, brewer_palettes, gradient, grayscale, hsb, mean, median, palette, rgb, rnd_color, scale, sum,
Comparison operators​
Containers-related operators​
-, ::, +, accumulate, all_match, among, at, cartesian_product, collect, contains, contains_all, contains_any, contains_key, count, empty, every, first, first_with, get, group_by, in, index_by, inter, interleave, internal_integrated_value, last, last_with, length, max, max_of, mean, mean_of, median, min, min_of, mul, none_matches, one_matches, one_of, product_of, range, remove_duplicates, reverse, shuffle, sort_by, split, split_in, split_using, sum, sum_of, union, variance_of, where, with_max_of, with_min_of,
Date-related operators​
-, !=, +, <, <=, =, >, >=, after, before, between, every, milliseconds_between, minus_days, minus_hours, minus_minutes, minus_months, minus_ms, minus_weeks, minus_years, months_between, plus_days, plus_hours, plus_minutes, plus_months, plus_ms, plus_weeks, plus_years, since, to, until, years_between,
Dates​
Displays​
edge​
EDP-related operators​
Files-related operators​
copy_file, crs, csv_file, delete_file, dxf_file, evaluate_sub_model, file_exists, folder, folder_exists, gaml_file, geojson_file, get, gif_file, gml_file, graph6_file, graphdimacs_file, graphdot_file, graphgexf_file, graphgml_file, graphml_file, graphtsplib_file, grid_file, image_file, is_csv, is_dxf, is_gaml, is_geojson, is_gif, is_gml, is_graph6, is_graphdimacs, is_graphdot, is_graphgexf, is_graphgml, is_graphml, is_graphtsplib, is_grid, is_image, is_json, is_obj, is_osm, is_pgm, is_property, is_saved_simulation, is_shape, is_svg, is_text, is_threeds, is_xml, json_file, new_folder, obj_file, osm_file, pgm_file, property_file, read, rename_file, saved_simulation_file, shape_file, step_sub_model, svg_file, text_file, threeds_file, unzip, writable, xml_file, zip,
FIPA-related operators​
GamaMaterialType​
GamaMetaType​
Gen*​
add_attribute, add_census_file, add_mapper, add_marginals, add_range_attribute, with_generation_algo,
Graphs-related operators​
add_edge, add_node, adjacency, agent_from_geometry, all_pairs_shortest_path, alpha_index, as_distance_graph, as_edge_graph, as_intersection_graph, as_path, as_spatial_graph, beta_index, betweenness_centrality, biggest_cliques_of, connected_components_of, connectivity_index, contains_edge, contains_vertex, degree_of, directed, edge, edge_between, edge_betweenness, edges, gamma_index, generate_barabasi_albert, generate_complete_graph, generate_random_graph, generate_watts_strogatz, girvan_newman_clustering, grid_cells_to_graph, in_degree_of, in_edges_of, k_spanning_tree_clustering, label_propagation_clustering, layout_circle, layout_force, layout_force_FR, layout_force_FR_indexed, layout_grid, load_shortest_paths, main_connected_component, max_flow_between, maximal_cliques_of, nb_cycles, neighbors_of, node, nodes, out_degree_of, out_edges_of, path_between, paths_between, predecessors_of, remove_node_from, rewire_n, source_of, spatial_graph, strahler, successors_of, sum, target_of, undirected, use_cache, weight_of, with_k_shortest_path_algorithm, with_shortest_path_algorithm, with_weights,
Grid-related operators​
as_4_grid, as_grid, as_hexagonal_grid, cell_at, cells_in, cells_overlapping, field, grid_at, neighbors_of, path_between, points_in, values_in,
Iterator operators​
accumulate, all_match, as_map, collect, count, create_map, first_with, frequency_of, group_by, index_by, last_with, max_of, mean_of, min_of, none_matches, one_matches, product_of, sort_by, sum_of, variance_of, where, where, where, with_max_of, with_min_of,
List-related operators​
all_indexes_of, copy_between, index_of, last_index_of,
Logical operators​
:, !, ?, add_3Dmodel, add_geometry, add_icon, and, or, xor,
Map comparaison operators​
fuzzy_kappa, fuzzy_kappa_sim, kappa, kappa_sim, percent_absolute_deviation,
Map-related operators​
as_map, create_map, index_of, last_index_of,
Matrix-related operators​
-, /, ., *, +, append_horizontally, append_vertically, column_at, columns_list, determinant, eigenvalues, index_of, inverse, last_index_of, row_at, rows_list, shuffle, trace, transpose,
multicriteria operators​
electre_DM, evidence_theory_DM, fuzzy_choquet_DM, promethee_DM, weighted_means_DM,
Path-related operators​
agent_from_geometry, all_pairs_shortest_path, as_path, load_shortest_paths, max_flow_between, path_between, path_to, paths_between, use_cache,
Points-related operators​
-, /, *, +, <, <=, >, >=, add_point, angle_between, any_location_in, centroid, closest_points_with, farthest_point_to, grid_at, norm, points_along, points_at, points_on,
Random operators​
binomial, flip, gamma_density, gamma_rnd, gamma_trunc_rnd, gauss, generate_terrain, lognormal_density, lognormal_rnd, lognormal_trunc_rnd, poisson, rnd, rnd_choice, sample, shuffle, skew_gauss, truncated_gauss, weibull_density, weibull_rnd, weibull_trunc_rnd,
ReverseOperators​
restore_simulation, restore_simulation_from_file, save_simulation, serialize, serialize_agent,
Shape​
arc, box, circle, cone, cone3D, cross, cube, curve, cylinder, ellipse, elliptical_arc, envelope, geometry_collection, hexagon, line, link, plan, polygon, polyhedron, pyramid, rectangle, sphere, square, squircle, teapot, triangle,
Spatial operators​
-, *, +, add_point, agent_closest_to, agent_farthest_to, agents_at_distance, agents_covering, agents_crossing, agents_inside, agents_overlapping, agents_partially_overlapping, agents_touching, angle_between, any_location_in, arc, around, as_4_grid, as_driving_graph, as_grid, as_hexagonal_grid, at_distance, at_location, box, centroid, circle, clean, clean_network, closest_points_with, closest_to, cone, cone3D, convex_hull, covering, covers, cross, crosses, crossing, crs, CRS_transform, cube, curve, cylinder, direction_between, disjoint_from, distance_between, distance_to, ellipse, elliptical_arc, envelope, farthest_point_to, farthest_to, geometry_collection, gini, hexagon, hierarchical_clustering, IDW, inside, inter, intersects, inverse_rotation, line, link, masked_by, moran, neighbors_at, neighbors_of, normalized_rotation, overlapping, overlaps, partially_overlapping, partially_overlaps, path_between, path_to, plan, points_along, points_at, points_on, polygon, polyhedron, pyramid, rectangle, rotated_by, rotation_composition, round, scaled_to, set_z, simple_clustering_by_distance, simplification, skeletonize, smooth, sphere, split_at, split_geometry, split_lines, square, squircle, teapot, to_GAMA_CRS, to_rectangles, to_segments, to_squares, to_sub_geometries, touches, touching, towards, transformed_by, translated_by, triangle, triangulate, union, using, voronoi, with_precision, without_holes,
Spatial properties operators​
covers, crosses, intersects, partially_overlaps, touches,
Spatial queries operators​
agent_closest_to, agent_farthest_to, agents_at_distance, agents_covering, agents_crossing, agents_inside, agents_overlapping, agents_partially_overlapping, agents_touching, at_distance, closest_to, covering, crossing, farthest_to, inside, neighbors_at, neighbors_of, overlapping, partially_overlapping, touching,
Spatial relations operators​
direction_between, distance_between, distance_to, path_between, path_to, towards,
Spatial statistical operators​
hierarchical_clustering, simple_clustering_by_distance,
Spatial transformations operators​
-, *, +, as_4_grid, as_grid, as_hexagonal_grid, at_location, clean, clean_network, convex_hull, CRS_transform, inverse_rotation, normalized_rotation, rotated_by, rotation_composition, scaled_to, simplification, skeletonize, smooth, split_geometry, split_lines, to_GAMA_CRS, to_rectangles, to_segments, to_squares, to_sub_geometries, transformed_by, translated_by, triangulate, voronoi, with_precision, without_holes,
Species-related operators​
index_of, last_index_of, of_generic_species, of_species,
Statistical operators​
auto_correlation, beta, binomial_coeff, binomial_complemented, binomial_sum, build, chi_square, chi_square_complemented, correlation, covariance, dbscan, distribution_of, distribution2d_of, dtw, durbin_watson, frequency_of, gamma, gamma_distribution, gamma_distribution_complemented, geometric_mean, gini, harmonic_mean, hierarchical_clustering, incomplete_beta, incomplete_gamma, incomplete_gamma_complement, kmeans, kurtosis, log_gamma, max, mean, mean_deviation, median, min, moment, moran, mul, normal_area, normal_density, normal_inverse, predict, pValue_for_fStat, pValue_for_tStat, quantile, quantile_inverse, rank_interpolated, rms, simple_clustering_by_distance, skewness, split, split_in, split_using, standard_deviation, student_area, student_t_inverse, sum, t_test, variance,
Strings-related operators​
+, <, <=, >, >=, at, capitalize, char, contains, contains_all, contains_any, copy_between, date, empty, first, in, indented_by, index_of, is_number, last, last_index_of, length, lower_case, regex_matches, replace, replace_regex, reverse, sample, shuffle, split_with, string, upper_case,
SubModel​
System​
., choose, command, copy, copy_to_clipboard, dead, enter, eval_gaml, every, is_error, is_reachable, is_warning, play_sound, user_confirm, user_input_dialog, wizard, wizard_page,
Time-related operators​
Types-related operators​
action, agent, attributes, BDIPlan, bool, container, directory, emotion, file, float, gaml_type, gen_population_generator, gen_range, geometry, graph, int, kml, list, map, matrix, mental_state, Norm, pair, path, point, predicate, regression, rgb, Sanction, skill, social_link, topology, unknown,
User control operators​
choose, enter, user_confirm, user_input_dialog, wizard, wizard_page,
Operators​
-
​
Possible uses:​
-
(int
) --->int
-
(float
) --->float
-
(point
) --->point
field
-
float
--->field
-
(field
,float
) --->field
matrix<unknown>
-
matrix
--->matrix
-
(matrix<unknown>
,matrix
) --->matrix
point
-
int
--->point
-
(point
,int
) --->point
geometry
-
geometry
--->geometry
-
(geometry
,geometry
) --->geometry
float
-
matrix
--->matrix
-
(float
,matrix
) --->matrix
int
-
int
--->int
-
(int
,int
) --->int
date
-
float
--->date
-
(date
,float
) --->date
geometry
-
float
--->geometry
-
(geometry
,float
) --->geometry
date
-
date
--->float
-
(date
,date
) --->float
matrix<unknown>
-
float
--->matrix
-
(matrix<unknown>
,float
) --->matrix
geometry
-
container<unknown,geometry>
--->geometry
-
(geometry
,container<unknown,geometry>
) --->geometry
field
-
int
--->field
-
(field
,int
) --->field
point
-
point
--->point
-
(point
,point
) --->point
container
-
container
--->list
-
(container
,container
) --->list
point
-
float
--->point
-
(point
,float
) --->point
float
-
float
--->float
-
(float
,float
) --->float
field
-
matrix
--->field
-
(field
,matrix
) --->field
matrix<unknown>
-
int
--->matrix
-
(matrix<unknown>
,int
) --->matrix
species
-
agent
--->list
-
(species
,agent
) --->list
map
-
map
--->map
-
(map
,map
) --->map
rgb
-
rgb
--->rgb
-
(rgb
,rgb
) --->rgb
list
-
unknown
--->list
-
(list
,unknown
) --->list
rgb
-
int
--->rgb
-
(rgb
,int
) --->rgb
date
-
int
--->date
-
(date
,int
) --->date
int
-
float
--->float
-
(int
,float
) --->float
float
-
int
--->float
-
(float
,int
) --->float
int
-
matrix
--->matrix
-
(int
,matrix
) --->matrix
map
-
pair
--->map
-
(map
,pair
) --->map
Result:​
Returns the difference of the two operands. If it is used as an unary operator, it returns the opposite of the operand.
Comment:​
The behavior of the operator depends on the type of the operands.
Special cases:​
- if both operands are containers and the right operand is empty, - returns the left operand
- if the left operand is a species and the right operand is an agent of the species, - returns a list containing all the agents of the species minus this agent
- if both operands are a point, a geometry or an agent, returns the geometry resulting from the difference between both geometries
geometry var0 <- geom1 - geom2; // var0 equals a geometry corresponding to difference between geom1 and geom2
- if both operands are numbers, performs a normal arithmetic difference and returns a float if one of them is a float.
int var1 <- 1 - 1; // var1 equals 0
- if the left-hand operand is a geometry and the right-hand operand a float, returns a geometry corresponding to the left-hand operand (geometry, agent, point) reduced by the right-hand operand distance
geometry var2 <- shape - 5; // var2 equals a geometry corresponding to the geometry of the agent applying the operator reduced by a distance of 5
- if both operands are dates, returns the duration in seconds between date2 and date1. To obtain a more precise duration, in milliseconds, use milliseconds_between(date1, date2)
float var3 <- date('2000-01-02') - date('2000-01-01'); // var3 equals 86400
- if the right-operand is a list of points, geometries or agents, returns the geometry resulting from the difference between the left-geometry and all of the right-geometries
geometry var4 <- rectangle(10,10) - [circle(2), square(2)]; // var4 equals rectangle(10,10) - (circle(2) + square(2))
- if both operands are points, returns their difference (coordinates per coordinates).
point var5 <- {1, 2} - {4, 5}; // var5 equals {-3.0, -3.0}
- if both operands are containers, returns a new list in which all the elements of the right operand have been removed from the left one
list<int> var6 <- [1,2,3,4,5,6] - [2,4,9]; // var6 equals [1,3,5,6]
list<int> var7 <- [1,2,3,4,5,6] - [0,8]; // var7 equals [1,2,3,4,5,6]
- if left-hand operand is a point and the right-hand a number, returns a new point with each coordinate as the difference of the operand coordinate with this number.
point var8 <- {1, 2} - 4.5; // var8 equals {-3.5, -2.5, -4.5}
point var9 <- {1, 2} - 4; // var9 equals {-3.0,-2.0,-4.0}
- if both operands are colors, returns a new color resulting from the subtraction of the two operands, component by component
rgb var10 <- rgb([255, 128, 32]) - rgb('red'); // var10 equals rgb([0,128,32])
- if the left operand is a list and the right operand is an object of any type (except list), - returns a list containing the elements of the left operand minus the first occurence of this object
list<int> var11 <- [1,2,3,4,5,6,2] - 2; // var11 equals [1,3,4,5,6,2]
list<int> var12 <- [1,2,3,4,5,6] - 0; // var12 equals [1,2,3,4,5,6]
- if one operand is a color and the other an integer, returns a new color resulting from the subtraction of each component of the color with the right operand
rgb var13 <- rgb([255, 128, 32]) - 3; // var13 equals rgb([252,125,29])
- if one of the operands is a date and the other a number, returns a date corresponding to the date minus the given number as duration (in seconds)
date var14 <- date('2000-01-01') - 86400; // var14 equals date('1999-12-31')
- if one operand is a matrix and the other a number (float or int), performs a normal arithmetic difference of the number with each element of the matrix (results are float if the number is a float.
matrix var15 <- 3.5 - matrix([[2,5],[3,4]]); // var15 equals matrix([[1.5,-1.5],[0.5,-0.5]])
Examples:​
point var16 <- {2.0,3.0,4.0} - 1; // var16 equals {1.0,2.0,3.0}
matrix var17 <- (10.0 - (3.0 as_matrix({2,3}))); // var17 equals matrix([[7.0,7.0,7.0],[7.0,7.0,7.0]])
date var18 <- date('2000-01-01') - 86400; // var18 equals date('1999-12-31')
float var19 <- 1.0 - 1.0; // var19 equals 0.0
float var20 <- 3.7 - 1.2; // var20 equals 2.5
float var21 <- 3.0 - 1.2; // var21 equals 1.8
map var22 <- ['a'::1,'b'::2] - ['b'::2]; // var22 equals ['a'::1]
map var23 <- ['a'::1,'b'::2] - ['b'::2,'c'::3]; // var23 equals ['a'::1]
int var24 <- - (-56); // var24 equals 56
point var25 <- -{3.0,5.0}; // var25 equals {-3.0,-5.0}
point var26 <- -{1.0,6.0,7.0}; // var26 equals {-1.0,-6.0,-7.0}
float var27 <- 1 - 1.0; // var27 equals 0.0
float var28 <- 3 - 1.2; // var28 equals 1.8
float var29 <- 1.0 - 1; // var29 equals 0.0
float var30 <- 3.7 - 1; // var30 equals 2.7
float var31 <- 3.0 - 1; // var31 equals 2.0
map var32 <- ['a'::1,'b'::2] - ('b'::2); // var32 equals ['a'::1]
map var33 <- ['a'::1,'b'::2] - ('c'::3); // var33 equals ['a'::1,'b'::2]
See also: +, *, /, milliseconds_between, -,
:
Possible uses:​
unknown
:
unknown
--->unknown
:
(unknown
,unknown
) --->unknown
Result:​
It is used in combination with the ? operator. If the left-hand of ? operand evaluates to true, returns the value of the left-hand operand of the :, otherwise that of the right-hand operand of the :
Examples:​
list<string> var0 <- [10, 19, 43, 12, 7, 22] collect ((each > 20) ? 'above' : 'below'); // var0 equals ['below', 'below', 'above', 'below', 'below', 'above']
See also: ?,
::
​
Possible uses:​
any expression
::
any expression
--->pair
::
(any expression
,any expression
) --->pair
Result:​
produces a new pair combining the left and the right operands
Special cases:​
- nil is not acceptable as a key (although it is as a value). If such a case happens, :: will throw an appropriate error
!
​
Possible uses:​
!
(bool
) --->bool
Result:​
opposite boolean value.
Special cases:​
- if the parameter is not boolean, it is casted to a boolean value.
Examples:​
bool var0 <- ! (true); // var0 equals false
!=
​
Possible uses:​
float
!=
float
--->bool
!=
(float
,float
) --->bool
date
!=
date
--->bool
!=
(date
,date
) --->bool
unknown
!=
unknown
--->bool
!=
(unknown
,unknown
) --->bool
int
!=
float
--->bool
!=
(int
,float
) --->bool
float
!=
int
--->bool
!=
(float
,int
) --->bool
Result:​
true if both operands are different, false otherwise
Examples:​
bool var0 <- 3.0 != 3.0; // var0 equals false
bool var1 <- 4.0 != 4.7; // var1 equals true
bool var2 <- #now != #now minus_hours 1; // var2 equals true
bool var3 <- [2,3] != [2,3]; // var3 equals false
bool var4 <- [2,4] != [2,3]; // var4 equals true
bool var5 <- 3 != 3.0; // var5 equals false
bool var6 <- 4 != 4.7; // var6 equals true
bool var7 <- 3.0 != 3; // var7 equals false
bool var8 <- 4.7 != 4; // var8 equals true
?
​
Possible uses:​
bool
?
any expression
--->unknown
?
(bool
,any expression
) --->unknown
Result:​
It is used in combination with the : operator: if the left-hand operand evaluates to true, returns the value of the left-hand operand of the :, otherwise that of the right-hand operand of the :
Comment:​
These functional tests can be combined together.
Examples:​
list<string> var0 <- [10, 19, 43, 12, 7, 22] collect ((each > 20) ? 'above' : 'below'); // var0 equals ['below', 'below', 'above', 'below', 'below', 'above']
rgb col <- (flip(0.3) ? #red : (flip(0.9) ? #blue : #green));
See also: :,
/
​
Possible uses:​
int
/
float
--->float
/
(int
,float
) --->float
int
/
int
--->float
/
(int
,int
) --->float
field
/
int
--->field
/
(field
,int
) --->field
rgb
/
float
--->rgb
/
(rgb
,float
) --->rgb
matrix<unknown>
/
matrix
--->matrix
/
(matrix<unknown>
,matrix
) --->matrix
matrix<unknown>
/
float
--->matrix
/
(matrix<unknown>
,float
) --->matrix
matrix<unknown>
/
int
--->matrix
/
(matrix<unknown>
,int
) --->matrix
point
/
int
--->point
/
(point
,int
) --->point
float
/
float
--->float
/
(float
,float
) --->float
rgb
/
int
--->rgb
/
(rgb
,int
) --->rgb
point
/
float
--->point
/
(point
,float
) --->point
field
/
float
--->field
/
(field
,float
) --->field
float
/
int
--->float
/
(float
,int
) --->float
Result:​
Returns the division of the two operands.
Special cases:​
- if the right-hand operand is equal to zero, raises a "Division by zero" exception
- if both operands are numbers (float or int), performs a normal arithmetic division and returns a float.
float var0 <- 3 / 5.0; // var0 equals 0.6
- if one operand is a color and the other a double, returns a new color resulting from the division of each component of the color by the right operand. The result on each component is then truncated.
rgb var1 <- rgb([255, 128, 32]) / 2.5; // var1 equals rgb([102,51,13])
- if one operand is a color and the other an integer, returns a new color resulting from the division of each component of the color by the right operand
rgb var2 <- rgb([255, 128, 32]) / 2; // var2 equals rgb([127,64,16])
- if the left operand is a point, returns a new point with coordinates divided by the right operand
point var3 <- {5, 7.5} / 2.5; // var3 equals {2, 3}
point var4 <- {2,5} / 4; // var4 equals {0.5,1.25}
.
​
Possible uses:​
agent
.
any expression
--->unknown
.
(agent
,any expression
) --->unknown
Result:​
It has two different uses: it can be the dot product between 2 matrices or return an evaluation of the expression (right-hand operand) in the scope the given agent.
Special cases:​
- if the agent is nil or dead, throws an exception
- if the left operand is an agent, it evaluates of the expression (right-hand operand) in the scope the given agent
unknown var0 <- agent1.location; // var0 equals the location of the agent agent1
.
​
Possible uses:​
matrix
.
matrix
--->matrix
.
(matrix
,matrix
) --->matrix
Special cases:​
- if both operands are matrix, returns the dot product of them
matrix var0 <- matrix([[1,1],[1,2]]) . matrix([[1,1],[1,2]]); // var0 equals matrix([[2,3],[3,5]])
^
​
Possible uses:​
float
^
float
--->float
^
(float
,float
) --->float
int
^
int
--->float
^
(int
,int
) --->float
float
^
int
--->float
^
(float
,int
) --->float
int
^
float
--->float
^
(int
,float
) --->float
Result:​
Returns the value (always a float) of the left operand raised to the power of the right operand.
Special cases:​
- if the right-hand operand is equal to 0, returns 1
- if it is equal to 1, returns the left-hand operand.
- Various examples of power
float var1 <- 2 ^ 3; // var1 equals 8.0
Examples:​
float var0 <- 4.84 ^ 0.5; // var0 equals 2.2
@
​
Same signification as at
*
​
Possible uses:​
rgb
*
int
--->rgb
*
(rgb
,int
) --->rgb
matrix<unknown>
*
float
--->matrix
*
(matrix<unknown>
,float
) --->matrix
matrix<unknown>
*
matrix
--->matrix
*
(matrix<unknown>
,matrix
) --->matrix
geometry
*
point
--->geometry
*
(geometry
,point
) --->geometry
field
*
float
--->field
*
(field
,float
) --->field
matrix<unknown>
*
int
--->matrix
*
(matrix<unknown>
,int
) --->matrix
float
*
float
--->float
*
(float
,float
) --->float
point
*
point
--->float
*
(point
,point
) --->float
point
*
int
--->point
*
(point
,int
) --->point
float
*
matrix
--->matrix
*
(float
,matrix
) --->matrix
geometry
*
float
--->geometry
*
(geometry
,float
) --->geometry
int
*
int
--->int
*
(int
,int
) --->int
int
*
matrix
--->matrix
*
(int
,matrix
) --->matrix
point
*
float
--->point
*
(point
,float
) --->point
rgb
*
float
--->rgb
*
(rgb
,float
) --->rgb
int
*
float
--->float
*
(int
,float
) --->float
float
*
int
--->float
*
(float
,int
) --->float
field
*
int
--->field
*
(field
,int
) --->field
Result:​
Returns the product of the two operands.
Special cases:​
- if one operand is a color and the other an integer, returns a new color resulting from the product of each component of the color with the right operand (with a maximum value at 255)
rgb var0 <- rgb([255, 128, 32]) * 2; // var0 equals rgb([255,255,64])
- if the left-hand operand is a geometry and the right-hand operand a point, returns a geometry corresponding to the left-hand operand (geometry, agent, point) scaled by the right-hand operand coefficients in the 3 dimensions
geometry var1 <- shape * {0.5,0.5,2}; // var1 equals a geometry corresponding to the geometry of the agent applying the operator scaled by a coefficient of 0.5 in x, 0.5 in y and 2 in z
- if both operands are points, returns their scalar product
float var2 <- {2,5} * {4.5, 5}; // var2 equals 34.0
- if the left-hand operator is a point and the right-hand a number, returns a point with coordinates multiplied by the number
point var3 <- {2,5} * 4; // var3 equals {8.0, 20.0}
point var4 <- {2, 4} * 2.5; // var4 equals {5.0, 10.0}
- if the left-hand operand is a geometry and the right-hand operand a float, returns a geometry corresponding to the left-hand operand (geometry, agent, point) scaled by the right-hand operand coefficient
geometry var5 <- circle(10) * 2; // var5 equals circle(20)
geometry var6 <- (circle(10) * 2).location with_precision 9; // var6 equals (circle(20)).location with_precision 9
float var7 <- (circle(10) * 2).height with_precision 9; // var7 equals (circle(20)).height with_precision 9
- if both operands are numbers (float or int), performs a normal arithmetic product and returns a float if one of them is a float.
int var8 <- 1 * 1; // var8 equals 1
- if one operand is a matrix and the other a number (float or int), performs a normal arithmetic product of the number with each element of the matrix (results are float if the number is a float.
matrix var9 <- 2 * matrix([[2,5],[3,4]]); // var9 equals matrix([[4,10],[6,8]])
- if one operand is a color and the other a float, returns a new color resulting from the product of each component of the color with the right operand (with a maximum value at 255)
rgb var10 <- rgb([255, 128, 32]) * 2.0; // var10 equals rgb([255,255,64])
Examples:​
float var11 <- 2.5 * 2; // var11 equals 5.0
+
​
Possible uses:​
point
+
float
--->point
+
(point
,float
) --->point
int
+
float
--->float
+
(int
,float
) --->float
date
+
int
--->date
+
(date
,int
) --->date
geometry
+
float
--->geometry
+
(geometry
,float
) --->geometry
matrix<unknown>
+
matrix
--->matrix
+
(matrix<unknown>
,matrix
) --->matrix
string
+
unknown
--->string
+
(string
,unknown
) --->string
point
+
point
--->point
+
(point
,point
) --->point
float
+
float
--->float
+
(float
,float
) --->float
container
+
container
--->container
+
(container
,container
) --->container
float
+
matrix
--->matrix
+
(float
,matrix
) --->matrix
point
+
int
--->point
+
(point
,int
) --->point
int
+
matrix
--->matrix
+
(int
,matrix
) --->matrix
field
+
matrix
--->field
+
(field
,matrix
) --->field
matrix<unknown>
+
float
--->matrix
+
(matrix<unknown>
,float
) --->matrix
int
+
int
--->int
+
(int
,int
) --->int
geometry
+
geometry
--->geometry
+
(geometry
,geometry
) --->geometry
field
+
float
--->field
+
(field
,float
) --->field
container
+
unknown
--->list
+
(container
,unknown
) --->list
rgb
+
rgb
--->rgb
+
(rgb
,rgb
) --->rgb
matrix<unknown>
+
int
--->matrix
+
(matrix<unknown>
,int
) --->matrix
string
+
string
--->string
+
(string
,string
) --->string
float
+
int
--->float
+
(float
,int
) --->float
rgb
+
int
--->rgb
+
(rgb
,int
) --->rgb
map
+
pair
--->map
+
(map
,pair
) --->map
date
+
string
--->string
+
(date
,string
) --->string
date
+
float
--->date
+
(date
,float
) --->date
field
+
int
--->field
+
(field
,int
) --->field
map
+
map
--->map
+
(map
,map
) --->map
+
(geometry
,float
,bool
) --->geometry
+
(geometry
,float
,int
) --->geometry
+
(geometry
,float
,int
,int
) --->geometry
+
(geometry
,float
,int
,int
,bool
) --->geometry
Result:​
Returns the sum, union or concatenation of the two operands.
Special cases:​
- if one of the operands is nil, + throws an error
- if both operands are species, returns a special type of list called meta-population
- if the left-hand operand is a point and the right-hand a number, returns a new point with each coordinate as the sum of the operand coordinate with this number.
point var0 <- {1, 2} + 4.5; // var0 equals {5.5, 6.5,4.5}
- if one of the operands is a date and the other a number, returns a date corresponding to the date plus the given number as duration (in seconds)
date var1 <- date('2000-01-01') + 86400; // var1 equals date('2000-01-02')
- if the left-hand operand is a geometry and the right-hand operand a float, returns a geometry corresponding to the left-hand operand (geometry, agent, point) enlarged by the right-hand operand distance. The number of segments used by default is 8 and the end cap style is #round
geometry var2 <- circle(5) + 5; // var2 equals circle(10)
- if the left-hand operand is a geometry and the right-hand operands a float, an integer, one of #round, #square or #flat and a boolean, returns a geometry corresponding to the left-hand operand (geometry, agent, point) enlarged by the first right-hand operand (distance), using a number of segments equal to the second right-hand operand and a flat, square or round end cap style and single sided is the boolean is true
geometry var3 <- line([{10,10}, {50,50}]) + (5,32,#round, true); // var3 equals A ploygon corresponding to the buffer generated
- if the left-hand operand is a string, returns the concatenation of the two operands (the left-hand one beind casted into a string)
string var4 <- "hello " + 12; // var4 equals "hello 12"
- if both operands are points, returns their sum.
point var5 <- {1, 2} + {4, 5}; // var5 equals {5.0, 7.0}
- if both operands are list, +returns the concatenation of both lists.
list<int> var6 <- [1,2,3,4,5,6] + [2,4,9]; // var6 equals [1,2,3,4,5,6,2,4,9]
list<int> var7 <- [1,2,3,4,5,6] + [0,8]; // var7 equals [1,2,3,4,5,6,0,8]
- if one operand is a matrix and the other a number (float or int), performs a normal arithmetic sum of the number with each element of the matrix (results are float if the number is a float.
matrix var8 <- 3.5 + matrix([[2,5],[3,4]]); // var8 equals matrix([[5.5,8.5],[6.5,7.5]])
- if both operands are numbers (float or int), performs a normal arithmetic sum and returns a float if one of them is a float.
int var9 <- 1 + 1; // var9 equals 2
- if the right-operand is a point, a geometry or an agent, returns the geometry resulting from the union between both geometries
geometry var10 <- geom1 + geom2; // var10 equals a geometry corresponding to union between geom1 and geom2
- if the right operand is an object of any type (except a container), + returns a list of the elements of the left operand, to which this object has been added
list<int> var11 <- [1,2,3,4,5,6] + 2; // var11 equals [1,2,3,4,5,6,2]
list<int> var12 <- [1,2,3,4,5,6] + 0; // var12 equals [1,2,3,4,5,6,0]
- if both operands are colors, returns a new color resulting from the sum of the two operands, component by component
rgb var13 <- rgb([255, 128, 32]) + rgb('red'); // var13 equals rgb([255,128,32])
- if the left-hand and right-hand operand are a string, returns the concatenation of the two operands
string var14 <- "hello " + "World"; // var14 equals "hello World"
- if the left-hand operand is a geometry and the right-hand operands a float and a boolean, returns a geometry corresponding to the left-hand operand (geometry, agent, point) enlarged by the first right-hand operand (distance), single sided is the boolean is true
geometry var15 <- line([{10,10}, {50,50}]) + (5, true); // var15 equals A ploygon corresponding to the buffer generated
- if one operand is a color and the other an integer, returns a new color resulting from the sum of each component of the color with the right operand
rgb var16 <- rgb([255, 128, 32]) + 3; // var16 equals rgb([255,131,35])
- if the left-hand operand is a geometry and the right-hand operands a float, an integer and one of #round, #square or #flat, returns a geometry corresponding to the left-hand operand (geometry, agent, point) enlarged by the first right-hand operand (distance), using a number of segments equal to the second right-hand operand and a flat, square or round end cap style
geometry var17 <- circle(5) + (5,32,#round); // var17 equals circle(10)
- if the left-hand operand is a geometry and the right-hand operands a float and an integer, returns a geometry corresponding to the left-hand operand (geometry, agent, point) enlarged by the first right-hand operand (distance), using a number of segments equal to the second right-hand operand
geometry var18 <- circle(5) + (5,32); // var18 equals circle(10)
Examples:​
point var19 <- {1, 2} + 4; // var19 equals {5.0, 6.0,4.0}
float var20 <- 1.0 + 1; // var20 equals 2.0
float var21 <- 1.0 + 2.5; // var21 equals 3.5
map var22 <- ['a'::1,'b'::2] + ('c'::3); // var22 equals ['a'::1,'b'::2,'c'::3]
map var23 <- ['a'::1,'b'::2] + ('c'::3); // var23 equals ['a'::1,'b'::2,'c'::3]
string var24 <- date('2000-01-01 00:00:00') + '_Test'; // var24 equals '2000-01-01 00:00:00_Test'
date var25 <- date('2016-01-01 00:00:01') + 86400; // var25 equals date('2016-01-02 00:00:01')
map var26 <- ['a'::1,'b'::2] + ['c'::3]; // var26 equals ['a'::1,'b'::2,'c'::3]
map var27 <- ['a'::1,'b'::2] + [5::3.0]; // var27 equals ['a'::1,'b'::2,5::3.0]
<
​
Possible uses:​
float
<
float
--->bool
<
(float
,float
) --->bool
point
<
point
--->bool
<
(point
,point
) --->bool
int
<
int
--->bool
<
(int
,int
) --->bool
int
<
float
--->bool
<
(int
,float
) --->bool
date
<
date
--->bool
<
(date
,date
) --->bool
float
<
int
--->bool
<
(float
,int
) --->bool
string
<
string
--->bool
<
(string
,string
) --->bool
Result:​
true if the left-hand operand is less than the right-hand operand, false otherwise.
Special cases:​
- if one of the operands is nil, returns false
- if both operands are points, returns true if and only if the left component (x) of the left operand if less than or equal to x of the right one and if the right component (y) of the left operand is greater than or equal to y of the right one.
bool var5 <- {5,7} < {4,6}; // var5 equals false
bool var6 <- {5,7} < {4,8}; // var6 equals false
- if both operands are String, uses a lexicographic comparison of two strings
bool var7 <- 'abc' < 'aeb'; // var7 equals true
Examples:​
bool var0 <- 3.5 < 7.6; // var0 equals true
bool var1 <- 3 < 7; // var1 equals true
bool var2 <- 3 < 2.5; // var2 equals false
bool var3 <- #now < #now minus_hours 1; // var3 equals false
bool var4 <- 3.5 < 7; // var4 equals true
<=
​
Possible uses:​
float
<=
float
--->bool
<=
(float
,float
) --->bool
date
<=
date
--->bool
<=
(date
,date
) --->bool
int
<=
float
--->bool
<=
(int
,float
) --->bool
int
<=
int
--->bool
<=
(int
,int
) --->bool
float
<=
int
--->bool
<=
(float
,int
) --->bool
string
<=
string
--->bool
<=
(string
,string
) --->bool
point
<=
point
--->bool
<=
(point
,point
) --->bool
Result:​
true if the left-hand operand is less or equal than the right-hand operand, false otherwise.
Special cases:​
- if one of the operands is nil, returns false
- if both operands are String, uses a lexicographic comparison of two strings
bool var5 <- 'abc' <= 'aeb'; // var5 equals true
- if both operands are points, returns true if and only if the left component (x) of the left operand if less than or equal to x of the right one and if the right component (y) of the left operand is greater than or equal to y of the right one.
bool var6 <- {5,7} <= {4,6}; // var6 equals false
bool var7 <- {5,7} <= {4,8}; // var7 equals false
Examples:​
bool var0 <- 3.5 <= 3.5; // var0 equals true
bool var1 <- (#now <= (#now minus_hours 1)); // var1 equals false
bool var2 <- 3 <= 2.5; // var2 equals false
bool var3 <- 3 <= 7; // var3 equals true
bool var4 <- 7.0 <= 7; // var4 equals true
=
​
Possible uses:​
int
=
float
--->bool
=
(int
,float
) --->bool
int
=
int
--->bool
=
(int
,int
) --->bool
date
=
date
--->bool
=
(date
,date
) --->bool
unknown
=
unknown
--->bool
=
(unknown
,unknown
) --->bool
float
=
float
--->bool
=
(float
,float
) --->bool
float
=
int
--->bool
=
(float
,int
) --->bool
Result:​
returns true if both operands are equal, false otherwise returns true if both operands are equal, false otherwise
Special cases:​
- if both operands are any kind of objects, returns true if they are identical (i.e., the same object) or equal (comparisons between nil values are permitted)
bool var0 <- [2,3] = [2,3]; // var0 equals true
Examples:​
bool var1 <- 3 = 3.0; // var1 equals true
bool var2 <- 4 = 4.7; // var2 equals false
bool var3 <- 4 = 5; // var3 equals false
bool var4 <- #now = #now minus_hours 1; // var4 equals false
bool var5 <- 4.5 = 4.7; // var5 equals false
bool var6 <- 4.7 = 4; // var6 equals false
>
​
Possible uses:​
string
>
string
--->bool
>
(string
,string
) --->bool
int
>
float
--->bool
>
(int
,float
) --->bool
float
>
float
--->bool
>
(float
,float
) --->bool
int
>
int
--->bool
>
(int
,int
) --->bool
point
>
point
--->bool
>
(point
,point
) --->bool
date
>
date
--->bool
>
(date
,date
) --->bool
float
>
int
--->bool
>
(float
,int
) --->bool
Result:​
true if the left-hand operand is greater than the right-hand operand, false otherwise.
Special cases:​
- if one of the operands is nil, returns false
- if both operands are String, uses a lexicographic comparison of two strings
bool var0 <- 'abc' > 'aeb'; // var0 equals false
- if both operands are points, returns true if and only if the left component (x) of the left operand if greater than x of the right one and if the right component (y) of the left operand is greater than y of the right one.
bool var1 <- {5,7} > {4,6}; // var1 equals true
bool var2 <- {5,7} > {4,8}; // var2 equals false
Examples:​
bool var3 <- 3 > 2.5; // var3 equals true
bool var4 <- 3.5 > 7.6; // var4 equals false
bool var5 <- 13.0 > 7.0; // var5 equals true
bool var6 <- (#now > (#now minus_hours 1)); // var6 equals true
bool var7 <- 3.5 > 7; // var7 equals false
>=
​
Possible uses:​
int
>=
int
--->bool
>=
(int
,int
) --->bool
date
>=
date
--->bool
>=
(date
,date
) --->bool
int
>=
float
--->bool
>=
(int
,float
) --->bool
float
>=
int
--->bool
>=
(float
,int
) --->bool
float
>=
float
--->bool
>=
(float
,float
) --->bool
string
>=
string
--->bool
>=
(string
,string
) --->bool
point
>=
point
--->bool
>=
(point
,point
) --->bool
Result:​
true if the left-hand operand is greater or equal than the right-hand operand, false otherwise.
Special cases:​
- if one of the operands is nil, returns false
- if both operands are string, uses a lexicographic comparison of the two strings
bool var5 <- 'abc' >= 'aeb'; // var5 equals false
bool var6 <- 'abc' >= 'abc'; // var6 equals true
- if both operands are points, returns true if and only if the left component (x) of the left operand if greater or equal than x of the right one and if the right component (y) of the left operand is greater than or equal to y of the right one.
bool var7 <- {5,7} >= {4,6}; // var7 equals true
bool var8 <- {5,7} >= {4,8}; // var8 equals false
Examples:​
bool var0 <- 3 >= 7; // var0 equals false
bool var1 <- #now >= #now minus_hours 1; // var1 equals true
bool var2 <- 3 >= 2.5; // var2 equals true
bool var3 <- 3.5 >= 7; // var3 equals false
bool var4 <- 3.5 >= 3.5; // var4 equals true
abs
​
Possible uses:​
abs
(int
) --->int
abs
(float
) --->float
Result:​
Returns the absolute value of the operand (so a positive int or float depending on the type of the operand).
Examples:​
int var0 <- abs (-10); // var0 equals 10
int var1 <- abs (10); // var1 equals 10
float var2 <- abs (200 * -1 + 0.5); // var2 equals 199.5
accumulate
​
Possible uses:​
container
accumulate
any expression
--->list
accumulate
(container
,any expression
) --->list
Result:​
returns a new flat list, in which each element is the evaluation of the right-hand operand. If this evaluation returns a list, the elements of this result are added directly to the list returned
Comment:​
accumulate is dedicated to the application of a same computation on each element of a container (and returns a list). In the right-hand operand, the keyword each can be used to represent, in turn, each of the left-hand operand elements.
Examples:​
list var0 <- [a1,a2,a3] accumulate (each neighbors_at 10); // var0 equals a flat list of all the neighbors of these three agents
list<int> var1 <- [1,2,4] accumulate ([2,4]); // var1 equals [2,4,2,4,2,4]
list<int> var2 <- [1,2,4] accumulate (each * 2); // var2 equals [2,4,8]
See also: collect,
acos
​
Possible uses:​
acos
(int
) --->float
acos
(float
) --->float
Result:​
Returns the value (in the interval [0,180], in decimal degrees) of the arccos of the operand (which should be in [-1,1]).
Special cases:​
- if the right-hand operand is outside of the [-1,1] interval, returns NaN
Examples:​
float var0 <- acos (0); // var0 equals 90.0
action
​
Possible uses:​
action
(any
) --->action
Result:​
casts the operand in a action object.
add_3Dmodel
​
Possible uses:​
add_3Dmodel
(kml
,point
,float
,float
,string
) --->kml
add_3Dmodel
(kml
,point
,float
,float
,string
,date
,date
) --->kml
Result:​
the kml export manager with new 3D model: specify the 3D model (collada) to add to the kml
See also: add_geometry, add_icon, add_label,
add_attribute
​
Possible uses:​
add_attribute
(gen_population_generator
,string
,any GAML type
,list
) --->gen_population_generator
add_attribute
(gen_population_generator
,string
,any GAML type
,list
,bool
) --->gen_population_generator
add_attribute
(gen_population_generator
,string
,any GAML type
,list
,string
,any GAML type
) --->gen_population_generator
add_attribute
(gen_population_generator
,string
,any GAML type
,list
,bool
,string
,any GAML type
) --->gen_population_generator
Result:​
add an attribute defined by its name (string), its datatype (type), its list of values (list) and attributeType name (type of the attribute among "range" and "unique") to a population_generator add an attribute defined by its name (string), its datatype (type), its list of values (list) to a population_generator add an attribute defined by its name (string), its datatype (type), its list of values (list) to a population_generator add an attribute defined by its name (string), its datatype (type), its list of values (list) and record name (name of the attribute to record) to a population_generator
Examples:​
add_attribute(pop_gen, "iris", string, liste_iris, "unique")
add_attribute(pop_gen, "Sex", string,["Man", "Woman"])
add_attribute(pop_gen, "Sex", string,["Man", "Woman"])
add_attribute(pop_gen, "iris", string,liste_iris, "unique", "P13_POP")
add_census_file
​
Possible uses:​
add_census_file
(gen_population_generator
,string
,string
,string
,int
,int
) --->gen_population_generator
Result:​
add a census data file defined by its path (string), its type ("ContingencyTable", "GlobalFrequencyTable", "LocalFrequencyTable" or "Sample"), its separator (string), the index of the first row of data (int) and the index of the first column of data (int) to a population_generator
Examples:​
add_census_file(pop_gen, "../data/Age_Couple.csv", "ContingencyTable", ";", 1, 1)
add_days
​
Same signification as plus_days
add_edge
​
Possible uses:​
graph
add_edge
pair
--->graph
add_edge
(graph
,pair
) --->graph
Result:​
add an edge between a source vertex and a target vertex (resp. the left and the right element of the pair operand)
Comment:​
WARNING / side effect: this operator modifies the operand and does not create a new graph. If the edge already exists, the graph is unchanged
Examples:​
graph <- graph add_edge (source::target);
add_geometry
​
Possible uses:​
add_geometry
(kml
,geometry
,float
,rgb
) --->kml
add_geometry
(kml
,geometry
,rgb
,rgb
) --->kml
add_geometry
(kml
,geometry
,float
,rgb
,rgb
) --->kml
add_geometry
(kml
,geometry
,float
,rgb
,rgb
,date
) --->kml
add_geometry
(kml
,geometry
,float
,rgb
,rgb
,date
,date
) --->kml
Result:​
Define the kml export manager with new geometry
See also: add_3Dmodel, add_icon, add_label,
add_hours
​
Same signification as plus_hours
add_icon
​
Possible uses:​
add_icon
(kml
,point
,float
,float
,string
) --->kml
add_icon
(kml
,point
,float
,float
,string
,date
,date
) --->kml
Result:​
Define the kml export manager with new icons
See also: add_geometry, add_icon,
add_mapper
​
Possible uses:​
add_mapper
(gen_population_generator
,string
,any GAML type
,map
) --->gen_population_generator
add_mapper
(gen_population_generator
,string
,any GAML type
,map
,bool
) --->gen_population_generator