-
Notifications
You must be signed in to change notification settings - Fork 99
OperatorsDH
This file is automatically generated from java files. Do Not Edit It.
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.
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.
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).
box, cone3D, cube, cylinder, hexagon, pyramid, set_z, sphere, teapot,
-, /, ^, *, +, 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,
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,
as, as_int, as_matrix, deserialize, field_with, font, from_gaml, from_json, is, is_skill, list_with, matrix_with, serialize, species_of, to_gaml, to_geojson, to_json, to_list, with_size, with_style,
-, /, *, +, blend, brewer_colors, brewer_palettes, gradient, grayscale, hsb, mean, median, palette, rgb, rnd_color, scale, sum, to_hsb,
-, ::, +, 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,
-, !=, +, <, <=, =, >, >=, 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,
agent_file, 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_agent, 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_shape, is_simulation, is_svg, is_text, is_threeds, is_xml, json_file, new_folder, obj_file, osm_file, pgm_file, property_file, read, rename_file, shape_file, simulation_file, step_sub_model, svg_file, text_file, threeds_file, unzip, writable, xml_file, zip,
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,
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,
*, antialiased, blend, blurred, brighter, clipped_with, darker, grayscale, horizontal_flip, image, matrix, rotated_by, sharpened, snapshot, tinted_with, vertical_flip, with_height, with_size, with_width,
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,
all_indexes_of, copy_between, index_of, last_index_of,
:, !, ?, add_3Dmodel, add_geometry, add_icon, and, or, xor,
fuzzy_kappa, fuzzy_kappa_sim, kappa, kappa_sim, percent_absolute_deviation,
as_map, create_map, index_of, last_index_of,
-, /, ., *, +, append_horizontally, append_vertically, column_at, columns_list, determinant, eigenvalues, flatten, index_of, inverse, last_index_of, row_at, rows_list, shuffle, trace, transpose,
electre_DM, evidence_theory_DM, fuzzy_choquet_DM, promethee_DM, weighted_means_DM,
agent_from_geometry, all_pairs_shortest_path, as_path, load_shortest_paths, max_flow_between, path_between, path_to, paths_between, use_cache,
-, /, *, +, <, <=, >, >=, add_point, angle_between, any_location_in, centroid, closest_points_with, farthest_point_to, grid_at, norm, points_along, points_at, points_on,
binomial, exp_density, exp_rnd, 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,
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,
-, *, +, 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, k_nearest_neighbors, 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,
covers, crosses, intersects, partially_overlaps, touches,
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,
direction_between, distance_between, distance_to, path_between, path_to, towards,
hierarchical_clustering, k_nearest_neighbors, simple_clustering_by_distance,
-, *, +, 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,
index_of, last_index_of, of_generic_species, of_species,
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, k_nearest_neighbors, kmeans, kurtosis, log_gamma, max, mean, mean_deviation, median, min, moment, moran, morrisAnalysis, mul, normal_area, normal_density, normal_inverse, predict, pValue_for_fStat, pValue_for_tStat, quantile, quantile_inverse, rank_interpolated, residuals, rms, rSquare, simple_clustering_by_distance, skewness, sobolAnalysis, split, split_in, split_using, standard_deviation, student_area, student_t_inverse, sum, t_test, variance,
+, <, <=, >, >=, at, capitalize, char, compress, 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, uncompress, upper_case,
., choose, command, copy, copy_from_clipboard, copy_to_clipboard, copy_to_clipboard, dead, enter, every, from_gaml, is_error, is_reachable, is_warning, play_sound, user_confirm, user_input_dialog, wizard, wizard_page,
action, agent, BDIPlan, bool, container, conversation, directory, emotion, file, float, gaml_type, geometry, graph, int, kml, list, map, matrix, mental_state, message, Norm, pair, path, point, predicate, regression, rgb, Sanction, skill, social_link, species, topology, unknown,
choose, enter, user_confirm, user_input_dialog, wizard, wizard_page,
-
darker
(image
) --->image
-
image
darker
float
--->image
-
darker
(image
,float
) --->image
Used to return an image 10% darker. This operation can be applied multiple times in a row if greater than 10% changes in brightness are desired. Used to return an image darker by a percentage (between 0 - no change - and 1 - 100% darker). If the percentage is below zero or abovde 1, returns the image untouched
-
string
date
string
--->date
-
date
(string
,string
) --->date
-
date
(string
,string
,string
) --->date
converts a string to a date following a custom pattern. The pattern can use "%Y %M %N %D %E %h %m %s %z" for outputting years, months, name of month, days, name of days, hours, minutes, seconds and the time-zone. A null or empty pattern will parse the date using one of the ISO date & time formats (similar to date('...') in that case). The pattern can also follow the pattern definition found here, which gives much more control over what will be parsed: https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html#patterns. Different patterns are available by default as constant: #iso_local, #iso_simple, #iso_offset, #iso_zoned and #custom, which can be changed in the preferences
- In addition to the date and pattern string operands, a specific locale (e.g. 'fr', 'en'...) can be added.
date d <- date("1999-january-30", 'yyyy-MMMM-dd', 'en');
date den <- date("1999-12-30", 'yyyy-MM-dd');
-
dbscan
(list
,float
,int
) --->list<list>
returns the list of clusters (list of instance indices) computed with the dbscan (density-based spatial clustering of applications with noise) algorithm from the first operand data according to the maximum radius of the neighborhood to be considered (eps) and the minimum number of points needed for a cluster (minPts). Usage: dbscan(data,eps,minPoints)
- if the lengths of two vectors in the right-hand aren't equal, returns 0
list<list> var0 <- dbscan ([[2,4,5], [3,8,2], [1,1,3], [4,3,4]],10,2); // var0 equals [[0,1,2,3]]
-
dead
(agent
) --->bool
true if the agent is dead (or null), false otherwise.
bool var0 <- dead(agent_A); // var0 equals true or false
Same signification as uncompress
-
graph
degree_of
unknown
--->int
-
degree_of
(graph
,unknown
) --->int
returns the degree (in+out) of a vertex (right-hand operand) in the graph given as left-hand operand.
int var1 <- graphFromMap degree_of (node(3)); // var1 equals 3
See also: in_degree_of, out_degree_of,
-
delete_file
(string
) --->bool
delete a file or a folder
bool delete_file_ok <- delete_file(["../includes/my_folder"];
-
deserialize
(string
) --->unknown
Deserializes an object precedently serialized using serialize
or to_binary
.It is safer to deserialize agents or simulations with the 'restore' or 'create' statements rather than with this operator.
See also: from_gaml, from_json,
Same signification as determinant
-
determinant
(matrix
) --->float
The determinant of the given matrix
float var0 <- determinant(matrix([[1,2],[3,4]])); // var0 equals -2
-
float
diff
float
--->float
-
diff
(float
,float
) --->float
A placeholder function for expressing equations
-
float
diff2
float
--->float
-
diff2
(float
,float
) --->float
A placeholder function for expressing equations
-
directed
(graph
) --->graph
the operand graph becomes a directed graph.
WARNING / side effect: this operator modifies the operand and does not create a new graph.
See also: undirected,
-
topology
direction_between
container<unknown,geometry>
--->float
-
direction_between
(topology
,container<unknown,geometry>
) --->float
A direction (in degree) between a list of two geometries (geometries, agents, points) considering a topology.
float var0 <- my_topology direction_between [ag1, ag2]; // var0 equals the direction between ag1 and ag2 considering the topology my_topology
See also: towards, direction_to, distance_to, distance_between, path_between, path_to,
Same signification as towards
-
directory
(any
) --->directory
casts the operand in a directory object.
-
geometry
disjoint_from
geometry
--->bool
-
disjoint_from
(geometry
,geometry
) --->bool
A boolean, equal to true if the left-geometry (or agent/point) is disjoints from the right-geometry (or agent/point).
- if one of the operand is null, returns true.
- if one operand is a point, returns false if the point is included in the geometry.
bool var0 <- polyline([{10,10},{20,20}]) disjoint_from polyline([{15,15},{25,25}]); // var0 equals false
bool var1 <- polygon([{10,10},{10,20},{20,20},{20,10}]) disjoint_from polygon([{15,15},{15,25},{25,25},{25,15}]); // var1 equals false
bool var2 <- polygon([{10,10},{10,20},{20,20},{20,10}]) disjoint_from {25,25}; // var2 equals true
bool var3 <- polygon([{10,10},{10,20},{20,20},{20,10}]) disjoint_from polygon([{35,35},{35,45},{45,45},{45,35}]); // var3 equals true
See also: intersects, crosses, overlaps, partially_overlaps, touches,
-
topology
distance_between
container<unknown,geometry>
--->float
-
distance_between
(topology
,container<unknown,geometry>
) --->float
A distance between a list of geometries (geometries, agents, points) considering a topology.
float var0 <- my_topology distance_between [ag1, ag2, ag3]; // var0 equals the distance between ag1, ag2 and ag3 considering the topology my_topology
See also: towards, direction_to, distance_to, direction_between, path_between, path_to,
-
point
distance_to
point
--->float
-
distance_to
(point
,point
) --->float
-
geometry
distance_to
geometry
--->float
-
distance_to
(geometry
,geometry
) --->float
A distance between two geometries (geometries, agents or points) considering the topology of the agent applying the operator.
float var0 <- ag1 distance_to ag2; // var0 equals the distance between ag1 and ag2 considering the topology of the agent applying the operator
See also: towards, direction_to, distance_between, direction_between, path_between, path_to,
Same signification as remove_duplicates
-
distribution_of
(container
) --->map
-
container
distribution_of
int
--->map
-
distribution_of
(container
,int
) --->map
-
distribution_of
(container
,int
,float
,float
) --->map
Discretize a list of values into n bins (computes the bins from a numerical variable into n (default 10) bins. Returns a distribution map with the values (values key), the interval legends (legend key), the distribution parameters (params keys, for cumulative charts). Parameters can be (list), (list, nbbins) or (list,nbbins,valmin,valmax)
map var0 <- distribution_of([1,1,2,12.5]); // var0 equals map(['values'::[2,1,0,0,0,0,1,0,0,0],'legend'::['[0.0:2.0]','[2.0:4.0]','[4.0:6.0]','[6.0:8.0]','[8.0:10.0]','[10.0:12.0]','[12.0:14.0]','[14.0:16.0]','[16.0:18.0]','[18.0:20.0]'],'parlist'::[1,0]])
map var1 <- distribution_of([1,1,2,12.5]); // var1 equals map(['values'::[2,1,0,0,0,0,1,0,0,0],'legend'::['[0.0:2.0]','[2.0:4.0]','[4.0:6.0]','[6.0:8.0]','[8.0:10.0]','[10.0:12.0]','[12.0:14.0]','[14.0:16.0]','[16.0:18.0]','[18.0:20.0]'],'parlist'::[1,0]])
map var2 <- distribution_of([1,1,2,12.5],10); // var2 equals map(['values'::[2,1,0,0,0,0,1,0,0,0],'legend'::['[0.0:2.0]','[2.0:4.0]','[4.0:6.0]','[6.0:8.0]','[8.0:10.0]','[10.0:12.0]','[12.0:14.0]','[14.0:16.0]','[16.0:18.0]','[18.0:20.0]'],'parlist'::[1,0]])
See also: as_map,
-
container
distribution2d_of
container
--->map
-
distribution2d_of
(container
,container
) --->map
-
distribution2d_of
(container
,container
,int
,int
) --->map
-
distribution2d_of
(container
,container
,int
,float
,float
,int
,float
,float
) --->map
Discretize two lists of values into n bins (computes the bins from a numerical variable into n (default 10) bins. Returns a distribution map with the values (values key), the interval legends (legend key), the distribution parameters (params keys, for cumulative charts). Parameters can be (list), (list, nbbins) or (list,nbbins,valmin,valmax)
map var0 <- distribution2d_of([1,1,2,12.5],10); // var0 equals map(['values'::[2,1,0,0,0,0,1,0,0,0],'legend'::['[0.0:2.0]','[2.0:4.0]','[4.0:6.0]','[6.0:8.0]','[8.0:10.0]','[10.0:12.0]','[12.0:14.0]','[14.0:16.0]','[16.0:18.0]','[18.0:20.0]'],'parlist'::[1,0]])
map var1 <- distribution2d_of([1,1,2,12.5]); // var1 equals map(['values'::[2,1,0,0,0,0,1,0,0,0],'legend'::['[0.0:2.0]','[2.0:4.0]','[4.0:6.0]','[6.0:8.0]','[8.0:10.0]','[10.0:12.0]','[12.0:14.0]','[14.0:16.0]','[16.0:18.0]','[18.0:20.0]'],'parlist'::[1,0]])
map var2 <- distribution2d_of([1,1,2,12.5],10); // var2 equals map(['values'::[2,1,0,0,0,0,1,0,0,0],'legend'::['[0.0:2.0]','[2.0:4.0]','[4.0:6.0]','[6.0:8.0]','[8.0:10.0]','[10.0:12.0]','[12.0:14.0]','[14.0:16.0]','[16.0:18.0]','[18.0:20.0]'],'parlist'::[1,0]])
See also: as_map,
-
int
div
float
--->int
-
div
(int
,float
) --->int
-
float
div
float
--->int
-
div
(float
,float
) --->int
-
int
div
int
--->int
-
div
(int
,int
) --->int
-
float
div
int
--->int
-
div
(float
,int
) --->int
Returns the truncation of the division of the left-hand operand by the right-hand operand.
- if the right-hand operand is equal to zero, raises an exception.
int var0 <- 40 div 4.1; // var0 equals 9
int var1 <- 40.1 div 4.5; // var1 equals 8
int var2 <- 40 div 3; // var2 equals 13
int var3 <- 40.5 div 3; // var3 equals 13
See also: mod,
Same signification as normal_density
-
list
dtw
list
--->float
-
dtw
(list
,list
) --->float
-
dtw
(list
,list
,int
) --->float
returns the dynamic time warping between the two series of values (step pattern used: symetric1) returns the dynamic time warping between the two series of values (step pattern used: symetric1) with Sakoe-Chiba band (radius: the window width of Sakoe-Chiba band)
float var0 <- dtw([32.0,5.0,1.0,3.0],[1.0,10.0,5.0,1.0]); // var0 equals 38.0
float var1 <- dtw([10.0,5.0,1.0, 3.0],[1.0,10.0,5.0,1.0], 2); // var1 equals 11.0
-
durbin_watson
(container
) --->float
Durbin-Watson computation
float var0 <- durbin_watson([13,2,1,4,1,2]) with_precision(4); // var0 equals 0.7231
-
dxf_file
(string
) --->file
-
string
dxf_file
float
--->file
-
dxf_file
(string
,float
) --->file
Constructs a file of type dxf. Allowed extensions are limited to dxf
- dxf_file(string): This file constructor allows to read a dxf (.dxf) file
file f <- dxf_file("file.dxf");
- dxf_file(string,float): This file constructor allows to read a dxf (.dxf) file and specify the unit (meter by default)
file f <- dxf_file("file.dxf",#m);
See also: is_dxf,
-
edge
(unknown
) --->unknown
-
edge
(pair
) --->unknown
-
pair
edge
int
--->unknown
-
edge
(pair
,int
) --->unknown
-
unknown
edge
unknown
--->unknown
-
edge
(unknown
,unknown
) --->unknown
-
unknown
edge
int
--->unknown
-
edge
(unknown
,int
) --->unknown
-
unknown
edge
float
--->unknown
-
edge
(unknown
,float
) --->unknown
-
pair
edge
float
--->unknown
-
edge
(pair
,float
) --->unknown
-
edge
(unknown
,unknown
,int
) --->unknown
-
edge
(pair
,unknown
,float
) --->unknown
-
edge
(pair
,unknown
,int
) --->unknown
-
edge
(unknown
,unknown
,float
) --->unknown
-
edge
(unknown
,unknown
,unknown
) --->unknown
-
edge
(unknown
,unknown
,unknown
,float
) --->unknown
-
edge
(unknown
,unknown
,unknown
,int
) --->unknown
Allows to create a wrapper (of type unknown) that wraps two objects and indicates they should be considered as the source and the target of a new edge of a graph. The third (omissible) parameter indicates which weight this edge should have in the graph
Useful only in graph-related operations (addition, removal of edges, creation of graphs)
-
graph
edge_between
pair
--->unknown
-
edge_between
(graph
,pair
) --->unknown
returns the edge linking two nodes
unknown var0 <- graphFromMap edge_between node1::node2; // var0 equals edge1
See also: out_edges_of, in_edges_of,
-
edge_betweenness
(graph
) --->map
returns a map containing for each edge (key), its betweenness centrality (value): number of shortest paths passing through each edge
graph graphEpidemio <- graph([]);
map var1 <- edge_betweenness(graphEpidemio); // var1 equals the edge betweenness index of the graph
-
edges
(container
) --->container
Allows to create a wrapper (of type list) that wraps a list of objects and indicates they should be considered as edges of a graph
-
eigenvalues
(matrix
) --->list<float>
The list of the eigen values of the given matrix
list<float> var0 <- eigenvalues(matrix([[5,-3],[6,-4]])); // var0 equals [2.0000000000000004,-0.9999999999999998]
-
electre_DM
(list<list>
,list<map<string,unknown>>
,float
) --->int
The index of the best candidate according to a method based on the ELECTRE methods. The principle of the ELECTRE methods is to compare the possible candidates by pair. These methods analyses the possible outranking relation existing between two candidates. A candidate outranks another if this one is at least as good as the other one. The ELECTRE methods are based on two concepts: the concordance and the discordance. The concordance characterizes the fact that, for an outranking relation to be validated, a sufficient majority of criteria should be in favor of this assertion. The discordance characterizes the fact that, for an outranking relation to be validated, none of the criteria in the minority should oppose too strongly this assertion. These two conditions must be true for validating the outranking assertion. More information about the ELECTRE methods can be found in Figueira, J., Mousseau, V., Roy, B.: ELECTRE Methods. In: Figueira, J., Greco, S., and Ehrgott, M., (Eds.), Multiple Criteria Decision Analysis: State of the Art Surveys, Springer, New York, 133--162 (2005). The first operand is the list of candidates (a candidate is a list of criterion values); the second operand the list of criterion: A criterion is a map that contains fives elements: a name, a weight, a preference value (p), an indifference value (q) and a veto value (v). The preference value represents the threshold from which the difference between two criterion values allows to prefer one vector of values over another. The indifference value represents the threshold from which the difference between two criterion values is considered significant. The veto value represents the threshold from which the difference between two criterion values disqualifies the candidate that obtained the smaller value; the last operand is the fuzzy cut.
- returns -1 is the list of candidates is nil or empty
int var0 <- electre_DM([[1.0, 7.0],[4.0,2.0],[3.0, 3.0]], [["name"::"utility", "weight" :: 2.0,"p"::0.5, "q"::0.0, "s"::1.0, "maximize" :: true],["name"::"price", "weight" :: 1.0,"p"::0.5, "q"::0.0, "s"::1.0, "maximize" :: false]],0.7); // var0 equals 0
See also: weighted_means_DM, promethee_DM, evidence_theory_DM,
-
float
ellipse
float
--->geometry
-
ellipse
(float
,float
) --->geometry
An ellipse geometry which x-radius is equal to the first operand and y-radius is equal to the second operand
the center of the ellipse is by default the location of the current agent in which has been called this operator.
- returns a point if both operands are lower or equal to 0, a line if only one is.
geometry var0 <- ellipse(10, 10); // var0 equals a geometry as an ellipse of width 10 and height 10.
See also: around, cone, line, link, norm, point, polygon, polyline, rectangle, square, circle, squircle, triangle,
-
elliptical_arc
(point
,point
,float
,int
) --->geometry
An elliptical arc from the first operand (point) to the second operand (point), which radius is equal to the third operand, and a int giving the number of points to use as a last operand
geometry var0 <- elliptical_arc({0,0},{10,10},5.0, 20); // var0 equals a geometry from {0,0} to {10,10} considering a radius of 5.0 built using 20 points
See also: arc, around, cone, line, link, norm, point, polygon, polyline, super_ellipse, rectangle, square, circle, ellipse, triangle,
-
emotion
(any
) --->emotion
casts the operand in a emotion object.
-
empty
(string
) --->bool
-
empty
(container<KeyType,ValueType>
) --->bool
true if the operand is empty, false otherwise.
the empty operator behavior depends on the nature of the operand
- if it is a map, empty returns true if the map contains no key-value mappings, and false otherwise
- if it is a file, empty returns true if the content of the file (that is also a container) is empty, and false otherwise
- if it is a population, empty returns true if there is no agent in the population, and false otherwise
- if it is a graph, empty returns true if it contains no vertex and no edge, and false otherwise
- if it is a matrix of int, float or object, it will return true if all elements are respectively 0, 0.0 or null, and false otherwise
- if it is a matrix of geometry, it will return true if the matrix contains no cell, and false otherwise
- if it is a string, empty returns true if the string does not contain any character, and false otherwise
bool var0 <- empty ('abced'); // var0 equals false
- if it is a list, empty returns true if there is no element in the list, and false otherwise
bool var1 <- empty([]); // var1 equals true
Same signification as +
-
string
enter
bool
--->unknown
-
enter
(string
,bool
) --->unknown
-
string
enter
string
--->unknown
-
enter
(string
,string
) --->unknown
-
string
enter
any GAML type
--->unknown
-
enter
(string
,any GAML type
) --->unknown
-
string
enter
float
--->unknown
-
enter
(string
,float
) --->unknown
-
string
enter
int
--->unknown
-
enter
(string
,int
) --->unknown
-
string
enter
unknown
--->unknown
-
enter
(string
,unknown
) --->unknown
-
enter
(string
,any GAML type
,unknown
) --->unknown
-
enter
(string
,int
,int
,int
) --->unknown
-
enter
(string
,float
,float
,float
) --->unknown
-
enter
(string
,float
,float
,float
,float
) --->unknown
-
enter
(string
,int
,int
,int
,int
) --->unknown
Allows the user to enter a string by specifying a title and an initial value
- When the second operand is the boolean type or a boolean value, the GUI is then a switch
map<string,unknown> m <- user_input(enter("Title",true));
map<string,unknown> m2 <- user_input(enter("Title",bool));
- The GUI is then a slider when an init value, a min (int or float), a max (int or float) (and eventually a step (int or float) ) operands.
map resMinMax <- user_input([enter("Title",5,0)])
map resMinMax <- user_input([enter("Title",5,0,10)])
map resMMStepFF <- user_input([enter("Title",5,0.1,10.1,0.5)]);
-
envelope
(unknown
) --->geometry
A 3D geometry that represents the box that surrounds the geometries or the surface described by the arguments. More general than geometry(arguments).envelope, as it allows to pass int, double, point, image files, shape files, asc files, or any list combining these arguments, in which case the envelope will be correctly expanded. If an envelope cannot be determined from the arguments, a default one of dimensions (0,100, 0, 100, 0, 100) is returned
- This operator is often used to define the environment of simulation
file road_shapefile <- file("../includes/roads.shp");
geometry shape <- envelope(road_shapefile);
// shape is the system variable of the environment
geometry var3 <- polygon([{0,0}, {20,0}, {10,10}, {10,0}]); // var3 equals create a polygon to get the envolpe
float var4 <- envelope(polygon([{0,0}, {20,0}, {10,10}, {10,0}])).area; // var4 equals 200.0
Same signification as from_gaml
-
eval_when
(BDIPlan
) --->bool
evaluate the facet when of a given plan
eval_when(plan1)
-
agent
evaluate_sub_model
string
--->unknown
-
evaluate_sub_model
(agent
,string
) --->unknown
Load a submodel
loaded submodel
-
even
(int
) --->bool
Returns true if the operand is even and false if it is odd.
- if the operand is equal to 0, it returns true.
- if the operand is a float, it is truncated before
bool var0 <- even (3); // var0 equals false
bool var1 <- even(-12); // var1 equals true
-
every
(int
) --->bool
-
every
(any expression
) --->bool
-
float
every
int
--->float
-
every
(float
,int
) --->float
-
list
every
int
--->list
-
every
(list
,int
) --->list
-
int
every
int
--->int
-
every
(int
,int
) --->int
-
list
every
any expression
--->list<date>
-
every
(list
,any expression
) --->list<date>
-
bool
every
int
--->bool
-
every
(bool
,int
) --->bool
-
unknown
every
int
--->unknown
-
every
(unknown
,int
) --->unknown
returns the first float operand every 2nd operand * cycle, 0.0 otherwise
Retrieves elements from the first argument every step
(second argument) elements. Raises an error if the step is negative or equal to zero
returns the first integer operand every 2nd operand * cycle, 0 otherwise
applies a step to an interval of dates defined by 'date1 to date2'. Beware that using every with #month or #year will produce odd results,as these pseudo-constants are not constant; only the first value will be used to compute the intervals, so, for instance, if current_date is set to February#month will only represent 28 or 29 days.
returns the first bool operand every 2nd operand * cycle, false otherwise
true every operand * cycle, false otherwise
returns the first operand every 2nd operand * cycle, nil otherwise
expects a frequency (expressed in seconds of simulated time) as argument. Will return true every time the current_date matches with this frequency
the value of the every operator depends on the cycle. It can be used to return a value every x cycle. 1000.0 every(10#cycle)
is strictly equivalent to every(10#cycle) ? 1000.0 : 0.0
the value of the every operator depends on the cycle. It can be used to return a value every x cycle. 1000 every(10#cycle)
is strictly equivalent to every(10#cycle) ? 1000 : 0
the value of the every operator depends on the cycle. It can be used to return a value every x cycle. object every(10#cycle)
is strictly equivalent to every(10#cycle) ? object : false
the value of the every operator depends on the cycle. It can be used to do something every x cycle.the value of the every operator depends on the cycle. It can be used to return a value every x cycle. object every(10#cycle)
is strictly equivalent to every(10#cycle) ? object : nil
Used to do something at regular intervals of time. Can be used in conjunction with 'since', 'after', 'before', 'until' or 'between', so that this computation only takes place in the temporal segment defined by these operators. In all cases, the starting_date of the model is used as a reference starting point
if (1000.0 every(2#cycle) != 0) {write "this is a value";}
else {write "this is 0.0";}
if (1000 every(2#cycle) != 0) {write "this is a value";}
else {write "this is 0";}
(date('2000-01-01') to date('2010-01-01')) every (#day) // builds an interval between these two dates which contains all the days starting from the beginning of the interval
if (true every(2#cycle) != false) {write "this is true";}
else {write "this is false";}
if every(2#cycle) {write "the cycle number is even";}
else {write "the cycle number is odd";}
if ({2000,2000} every(2#cycle) != nil) {write "this is a point";}
else {write "this is nil";}
reflex when: every(2#days) since date('2000-01-01') { .. }
state a { transition to: b when: every(2#mn);} state b { transition to: a when: every(30#s);} // This oscillatory behavior will use the starting_date of the model as its starting point in time
Same signification as every
-
list<list>
evidence_theory_DM
list<map<string,unknown>>
--->int
-
evidence_theory_DM
(list<list>
,list<map<string,unknown>>
) --->int
-
evidence_theory_DM
(list<list>
,list<map<string,unknown>>
,bool
) --->int
The index of the best candidate according to a method based on the Evidence theory. This theory, which was proposed by Shafer (Shafer G (1976) A mathematical theory of evidence, Princeton University Press), is based on the work of Dempster (Dempster A (1967) Upper and lower probabilities induced by multivalued mapping. Annals of Mathematical Statistics, vol. 38, pp. 325--339) on lower and upper probability distributions. The first operand is the list of candidates (a candidate is a list of criterion values); the second operand the list of criterion: A criterion is a map that contains seven elements: a name, a first threshold s1, a second threshold s2, a value for the assertion "this candidate is the best" at threshold s1 (v1p), a value for the assertion "this candidate is the best" at threshold s2 (v2p), a value for the assertion "this candidate is not the best" at threshold s1 (v1c), a value for the assertion "this candidate is not the best" at threshold s2 (v2c). v1p, v2p, v1c and v2c have to been defined in order that: v1p + v1c <= 1.0; v2p + v2c <= 1.0.; the last operand allows to use a simple version of this multi-criteria decision making method (simple if true)
- returns -1 is the list of candidates is nil or empty
- if the operator is used with only 2 operands (the candidates and the criteria), the last parameter (use simple method) is set to true
int var0 <- evidence_theory_DM([[1.0, 7.0],[4.0,2.0],[3.0, 3.0]], [["name"::"utility", "s1" :: 0.0,"s2"::1.0, "v1p"::0.0, "v2p"::1.0, "v1c"::0.0, "v2c"::0.0, "maximize" :: true],["name"::"price", "s1" :: 0.0,"s2"::1.0, "v1p"::0.0, "v2p"::1.0, "v1c"::0.0, "v2c"::0.0, "maximize" :: true]], false); // var0 equals 0
int var1 <- evidence_theory_DM([[1.0, 7.0],[4.0,2.0],[3.0, 3.0]], [["name"::"utility", "s1" :: 0.0,"s2"::1.0, "v1p"::0.0, "v2p"::1.0, "v1c"::0.0, "v2c"::0.0, "maximize" :: true],["name"::"price", "s1" :: 0.0,"s2"::1.0, "v1p"::0.0, "v2p"::1.0, "v1c"::0.0, "v2c"::0.0, "maximize" :: true]]); // var1 equals 0
See also: weighted_means_DM, electre_DM,
-
exp
(int
) --->float
-
exp
(float
) --->float
Returns Euler's number e raised to the power of the operand.
- the operand is casted to a float before being evaluated.
float var0 <- exp (0.0); // var0 equals 1.0
See also: ln,
-
float
exp_density
float
--->float
-
exp_density
(float
,float
) --->float
returns the probability density function (PDF) at the specified point x of the exponential distribution with the given rate.
float var0 <- exp_density(5,3) ; // var0 equals 0.731
See also: binomial, gamma_rnd, gauss_rnd, lognormal_rnd, poisson, rnd, skew_gauss, lognormal_density, gamma_density,
-
exp_rnd
(float
) --->float
returns a random value from a exponential distribution with specified values of the rate (lambda) parameters. See https://mathworld.wolfram.com/ExponentialDistribution.html for more details ).
float var0 <- exp_rnd(5) ; // var0 equals 0.731
See also: binomial, gamma_rnd, gauss_rnd, lognormal_rnd, poisson, rnd, skew_gauss, truncated_gauss, weibull_trunc_rnd,
-
fact
(int
) --->float
Returns the factorial of the operand.
- if the operand is less than 0, fact returns 0.
float var0 <- fact(4); // var0 equals 24
-
geometry
farthest_point_to
point
--->point
-
farthest_point_to
(geometry
,point
) --->point
the farthest point of the left-operand to the left-point.
point var0 <- geom farthest_point_to(pt); // var0 equals the farthest point of geom to pt
See also: any_location_in, any_point_in, closest_points_with, points_at,
-
container<unknown,geometry>
farthest_to
geometry
--->geometry
-
farthest_to
(container<unknown,geometry>
,geometry
) --->geometry
An agent or a geometry among the left-operand list of agents, species or meta-population (addition of species), the farthest to the operand (casted as a geometry).
the distance is computed in the topology of the calling agent (the agent in which this operator is used), with the distance algorithm specific to the topology.
geometry var0 <- [ag1, ag2, ag3] closest_to(self); // var0 equals return the farthest agent among ag1, ag2 and ag3 to the agent applying the operator.
(species1 + species2) closest_to self
See also: neighbors_at, neighbors_of, inside, overlapping, agents_overlapping, agents_inside, agent_closest_to, closest_to, agent_farthest_to,
-
int
field
int
--->field
-
field
(int
,int
) --->field
-
unknown
field
float
--->field
-
field
(unknown
,float
) --->field
-
field
(int
,int
,float
) --->field
-
field
(int
,int
,float
,float
) --->field
-
point
field_with
any expression
--->field
-
field_with
(point
,any expression
) --->field
creates a field with a size provided by the first operand, and filled by the evaluation of the second operand for each cell
Note that both components of the right operand point should be positive, otherwise an exception is raised.
-
file
(any
) --->file
casts the operand in a file object.
-
file_exists
(string
) --->bool
Test whether the parameter is the path to an existing file. False if it does not exist of if it is a folder
string file_name <-"../includes/buildings.shp";
if file_exists(file_name){
write "File exists in the computer";
}
-
first
(string
) --->string
-
first
(container<KeyType,ValueType>
) --->ValueType
-
int
first
container
--->list
-
first
(int
,container
) --->list
the first value of the operand
the first operator behavior depends on the nature of the operand
- if it is a map, first returns the first value of the first pair (in insertion order)
- if it is a file, first returns the first element of the content of the file (that is also a container)
- if it is a population, first returns the first agent of the population
- if it is a graph, first returns the first edge (in creation order)
- if it is a matrix, first returns the element at {0,0} in the matrix
- for a matrix of int or float, it will return 0 if the matrix is empty
- for a matrix of object or geometry, it will return nil if the matrix is empty
- if it is a string, first returns a string composed of its first character
string var0 <- first ('abce'); // var0 equals 'a'
- if it is a list, first returns the first element of the list, or nil if the list is empty
int var1 <- first ([1, 2, 3]); // var1 equals 1
See also: last,
Same signification as first
-
container
first_with
any expression
--->unknown
-
first_with
(container
,any expression
) --->unknown
the first element of the left-hand operand that makes the right-hand operand evaluate to true.
in the right-hand operand, the keyword each can be used to represent, in turn, each of the right-hand operand elements.
- if the left-hand operand is nil, first_with throws an error. If there is no element that satisfies the condition, it returns nil
- if the left-operand is a map, the keyword each will contain each value
int var4 <- [1::2, 3::4, 5::6] first_with (each >= 4); // var4 equals 4
pair var5 <- [1::2, 3::4, 5::6].pairs first_with (each.value >= 4); // var5 equals (3::4)
unknown var0 <- [1,2,3,4,5,6,7,8] first_with (each > 3); // var0 equals 4
unknown var2 <- g2 first_with (length(g2 out_edges_of each) = 0); // var2 equals node9
unknown var3 <- (list(node) first_with (round(node(each).location.x) > 32); // var3 equals node2
See also: group_by, last_with, where,
-
flatten
(field
) --->field
-
field
flatten
unknown
--->field
-
flatten
(field
,unknown
) --->field
-
flip
(float
) --->bool
true or false given the probability represented by the operand
- flip 0 always returns false, flip 1 true
bool var0 <- flip (0.66666); // var0 equals 2/3 chances to return true.
See also: rnd,
-
float
(any
) --->float
casts the operand in a float object.
-
floor
(float
) --->int
Maps the operand to the largest previous following integer, i.e. the largest integer not greater than x.
int var0 <- floor(3); // var0 equals 3
int var1 <- floor(3.5); // var1 equals 3
int var2 <- floor(-4.7); // var2 equals -5
-
folder
(string
) --->file
opens an existing repository
- If the specified string does not refer to an existing repository, an exception is risen.
file dirT <- folder("../includes/");
// dirT represents the repository "../includes/"
// dirT.contents here contains the list of the names of included files
See also: file, new_folder,
-
folder_exists
(string
) --->bool
Test whether the parameter is the path to an existing folder. False if it doesnt exist or if it is a file
string file_name <-"../includes/";
if folder_exists(file_name){
write "Folder exists in the computer";
}
-
string
font
int
--->font
-
font
(string
,int
) --->font
-
font
(string
,int
,int
) --->font
Creates a new font, by specifying its name (either a font face name like 'Lucida Grande Bold' or 'Helvetica', or a logical name like 'Dialog', 'SansSerif', 'Serif', etc.), a size in points and a style, either #bold, #italic or #plain or a combination (addition) of them.
font var0 <- font ('Helvetica Neue',12, #bold + #italic); // var0 equals a bold and italic face of the Helvetica Neue family
-
container
frequency_of
any expression
--->map
-
frequency_of
(container
,any expression
) --->map
Returns a map with keys equal to the application of the right-hand argument (like collect) and values equal to the frequency of this key (i.e. how many times it has been obtained)
map var0 <- [1, 2, 3, 3, 4, 4, 5, 3, 3, 4] frequency_of each; // var0 equals map([1::1,2::1,3::4,4::3,5::1])
Same signification as since
Same signification as deserialize
-
from_gaml
(string
) --->unknown
Evaluates/deserialises the given GAML string into a value.
unknown var0 <- eval_gaml("2+3"); // var0 equals 5
-
from_json
(string
) --->unknown
Deserializes an object precedently serialized using 'to_json' (or an arbitrary json string obtained elsewhere). Agents and populations are not supported yet (i.e. they will return maps)
See also: from_gaml, from_binary,
-
fuzzy_choquet_DM
(list<list>
,list<string>
,map
) --->int
The index of the candidate that maximizes the Fuzzy Choquet Integral value. The first operand is the list of candidates (a candidate is a list of criterion values); the second operand the list of criterion (list of string); the third operand the weights of each sub-set of criteria (map with list for key and float for value)
- returns -1 is the list of candidates is nil or empty
int var0 <- fuzzy_choquet_DM([[1.0, 7.0],[4.0,2.0],[3.0, 3.0]], ["utility", "price", "size"],[["utility"]::0.5,["size"]::0.1,["price"]::0.4,["utility", "price"]::0.55]); // var0 equals 0
See also: promethee_DM, electre_DM, evidence_theory_DM,
-
fuzzy_kappa
(list<agent>
,list<unknown>
,list<unknown>
,list<float>
,list<unknown>
,matrix<float>
,float
) --->float
-
fuzzy_kappa
(list<agent>
,list<unknown>
,list<unknown>
,list<float>
,list<unknown>
,matrix<float>
,float
,list<unknown>
) --->float
fuzzy kappa indicator for 2 map comparisons: fuzzy_kappa(agents_list,list_vals1,list_vals2, output_similarity_per_agents,categories,fuzzy_categories_matrix, fuzzy_distance). Reference: Visser, H., and T. de Nijs, 2006. The map comparison kit, Environmental Modelling & Software, 21 fuzzy kappa indicator for 2 map comparisons: fuzzy_kappa(agents_list,list_vals1,list_vals2, output_similarity_per_agents,categories,fuzzy_categories_matrix, fuzzy_distance, weights). Reference: Visser, H., and T. de Nijs, 2006. The map comparison kit, Environmental Modelling & Software, 21
fuzzy_kappa([ag1, ag2, ag3, ag4, ag5],[cat1,cat1,cat2,cat3,cat2],[cat2,cat1,cat2,cat1,cat2], similarity_per_agents,[cat1,cat2,cat3],[[1,0,0],[0,1,0],[0,0,1]], 2)
fuzzy_kappa([ag1, ag2, ag3, ag4, ag5],[cat1,cat1,cat2,cat3,cat2],[cat2,cat1,cat2,cat1,cat2], similarity_per_agents,[cat1,cat2,cat3],[[1,0,0],[0,1,0],[0,0,1]], 2, [1.0,3.0,2.0,2.0,4.0])
-
fuzzy_kappa_sim
(list<agent>
,list<unknown>
,list<unknown>
,list<unknown>
,list<float>
,list<unknown>
,matrix<float>
,float
) --->float
-
fuzzy_kappa_sim
(list<agent>
,list<unknown>
,list<unknown>
,list<unknown>
,list<float>
,list<unknown>
,matrix<float>
,float
,list<unknown>
) --->float
fuzzy kappa simulation indicator for 2 map comparisons: fuzzy_kappa_sim(agents_list,list_vals1,list_vals2, output_similarity_per_agents,fuzzy_transitions_matrix, fuzzy_distance). Reference: Jasper van Vliet, Alex Hagen-Zanker, Jelle Hurkens, Hedwig van Delden, A fuzzy set approach to assess the predictive accuracy of land use simulations, Ecological Modelling, 24 July 2013, Pages 32-42, ISSN 0304-3800, fuzzy kappa simulation indicator for 2 map comparisons: fuzzy_kappa_sim(agents_list,list_vals1,list_vals2, output_similarity_per_agents,fuzzy_transitions_matrix, fuzzy_distance, weights). Reference: Jasper van Vliet, Alex Hagen-Zanker, Jelle Hurkens, Hedwig van Delden, A fuzzy set approach to assess the predictive accuracy of land use simulations, Ecological Modelling, 24 July 2013, Pages 32-42, ISSN 0304-3800,
fuzzy_kappa_sim([ag1, ag2, ag3, ag4, ag5], [cat1,cat1,cat2,cat3,cat2],[cat2,cat1,cat2,cat1,cat2], similarity_per_agents,[cat1,cat2,cat3],[[1,0,0,0,0,0,0,0,0],[0,1,0,0,0,0,0,0,0],[0,0,1,0,0,0,0,0,0],[0,0,0,1,0,0,0,0,0],[0,0,0,0,1,0,0,0,0],[0,0,0,0,0,1,0,0,0],[0,0,0,0,0,0,1,0,0],[0,0,0,0,0,0,0,1,0],[0,0,0,0,0,0,0,0,1]], 2)
fuzzy_kappa_sim([ag1, ag2, ag3, ag4, ag5], [cat1,cat1,cat2,cat3,cat2],[cat2,cat1,cat2,cat1,cat2], similarity_per_agents,[cat1,cat2,cat3],[[1,0,0,0,0,0,0,0,0],[0,1,0,0,0,0,0,0,0],[0,0,1,0,0,0,0,0,0],[0,0,0,1,0,0,0,0,0],[0,0,0,0,1,0,0,0,0],[0,0,0,0,0,1,0,0,0],[0,0,0,0,0,0,1,0,0],[0,0,0,0,0,0,0,1,0],[0,0,0,0,0,0,0,0,1]], 2,[1.0,3.0,2.0,2.0,4.0])
-
gaml_file
(string
) --->file
Constructs a file of type gaml. Allowed extensions are limited to gaml, experiment
- gaml_file(string): This file constructor allows to read a gaml file (.gaml)
file f <- gaml_file("file.gaml");
See also: is_gaml,
-
gaml_type
(any
) --->gaml_type
casts the operand in a gaml_type object.
-
gamma
(float
) --->float
Returns the value of the Gamma function at x.
float var0 <- gamma(5); // var0 equals 24.0
-
gamma_density
(float
,float
,float
) --->float
gamma_density(x,shape,scale) returns the probability density function (PDF) at the specified point x of the Gamma distribution with the given shape and scale.
float var0 <- gamma_density(1,9,0.5); // var0 equals 0.731
See also: binomial, gauss_rnd, lognormal_rnd, poisson, rnd, skew_gauss, truncated_gauss, weibull_rnd, weibull_density, lognormal_density,
-
gamma_distribution
(float
,float
,float
) --->float
Returns the integral from zero to x of the gamma probability density function.
incomplete_gamma(a,x) is equal to pgamma(a,1,x).
float var0 <- gamma_distribution(2,3,0.9) with_precision(3); // var0 equals 0.269
-
gamma_distribution_complemented
(float
,float
,float
) --->float
Returns the integral from x to infinity of the gamma probability density function.
float var0 <- gamma_distribution_complemented(2,3,0.9) with_precision(3); // var0 equals 0.731
-
gamma_index
(graph
) --->float
returns the gamma index of the graph (A measure of connectivity that considers the relationship between the number of observed links and the number of possible links: gamma = e/(3 *
(v - 2)) - for planar graph.
graph graphEpidemio <- graph([]);
float var1 <- gamma_index(graphEpidemio); // var1 equals the gamma index of the graph
See also: alpha_index, beta_index, nb_cycles, connectivity_index,
-
float
gamma_rnd
float
--->float
-
gamma_rnd
(float
,float
) --->float
returns a random value from a gamma distribution with specified values of the shape and scale parameters
float var0 <- gamma_rnd(9,0.5); // var0 equals 0.731
See also: binomial, gauss_rnd, lognormal_rnd, poisson, rnd, skew_gauss, truncated_gauss, weibull_rnd, gamma_trunc_rnd,
-
gamma_trunc_rnd
(float
,float
,float
,float
) --->float
-
gamma_trunc_rnd
(float
,float
,float
,bool
) --->float
returns a random value from a truncated gamma distribution (in a range or given only one boundary) with specified values of the shape and scale parameters.
- when 2 float operands are specified, they are taken as mininimum and maximum values for the result
gamma_trunc_rnd(2,3,0,5)
- when 1 float and a boolean (isMax) operands are specified, the float value represents the single boundary (max if the boolean is true, min otherwise),
gamma_trunc_rnd(2,3,5,true)
See also: gamma_rnd, weibull_trunc_rnd, lognormal_trunc_rnd, truncated_gauss,
-
gauss
(point
) --->float
-
float
gauss
float
--->float
-
gauss
(float
,float
) --->float
The operator can be used with an operand of type point {meand,standardDeviation}. A value from a normally distributed random variable with expected value (mean as first operand) and variance (standardDeviation as second operand). The probability density function of such a variable is a Gaussian.
- when the operand is a point, it is read as {mean, standardDeviation}
- when standardDeviation value is 0.0, it always returns the mean value
float var0 <- gauss({0,0.3}); // var0 equals 0.22354
float var1 <- gauss(0,0.3); // var1 equals 0.22354
See also: binomial, gamma_rnd, lognormal_rnd, poisson, rnd, skew_gauss, truncated_gauss, weibull_rnd,
Same signification as gauss
-
generate_barabasi_albert
(container
,int
,int
,bool
) --->graph
-
generate_barabasi_albert
(int
,int
,int
,bool
) --->graph
-
generate_barabasi_albert
(int
,int
,int
,bool
,species
) --->graph
-
generate_barabasi_albert
(int
,int
,int
,bool
,species
,species
) --->graph
returns a random scale-free network (following Barabasi-Albert (BA) model).
The Barabasi-Albert (BA) model is an algorithm for generating random scale-free networks using a preferential attachment mechanism. A scale-free network is a network whose degree distribution follows a power law, at least asymptotically.Such networks are widely observed in natural and human-made systems, including the Internet, the world wide web, citation networks, and some social networks. [From Wikipedia article]The map operand should includes following elements:The Barabasi-Albert (BA) model is an algorithm for generating random scale-free networks using a preferential attachment mechanism. A scale-free network is a network whose degree distribution follows a power law, at least asymptotically.Such networks are widely observed in natural and human-made systems, including the Internet, the world wide web, citation networks, and some social networks. [From Wikipedia article]The map operand should includes following elements:The Barabasi-Albert (BA) model is an algorithm for generating random scale-free networks using a preferential attachment mechanism. A scale-free network is a network whose degree distribution follows a power law, at least asymptotically.Such networks are widely observed in natural and human-made systems, including the Internet, the world wide web, citation networks, and some social networks. [From Wikipedia article]The map operand should includes following elements:The Barabasi-Albert (BA) model is an algorithm for generating random scale-free networks using a preferential attachment mechanism. A scale-free network is a network whose degree distribution follows a power law, at least asymptotically.Such networks are widely observed in natural and human-made systems, including the Internet, the world wide web, citation networks, and some social networks. [From Wikipedia article]The map operand should includes following elements:
- "nbInitNodes": number of initial nodes; "nodes": list of existing nodes to connect (agents or geometries); "nbEdgesAdded": number of edges of each new node added during the network growth; "directed": is the graph directed or not;
graph myGraph <- generate_watts_strogatz(people, 10,1,false);
- "nbInitNodes": number of initial nodes; "nbEdgesAdded": number of edges of each new node added during the network growth; "nbNodes": final number of nodes; "directed": is the graph directed or not; "node_species": the species of vertices; "edges_species": the species of edges
graph<myVertexSpecy,myEdgeSpecy> myGraph <- generate_watts_strogatz(
60,
1,
100,
true,
myVertexSpecies);
- "nbInitNodes": number of initial nodes; "nbEdgesAdded": number of edges of each new node added during the network growth; "nbNodes": final number of nodes; "directed": is the graph directed or not; "node_species": the species of vertices; "edges_species": the species of edges
graph<myVertexSpecy,myEdgeSpecy> myGraph <- generate_watts_strogatz(
60,
1,
100,
true,
myVertexSpecies,
myEdgeSpecies);
- "nbInitNodes": number of initial nodes; "nbEdgesAdded": number of edges of each new node added during the network growth; "nbNodes": final number of nodes; "directed": is the graph directed or not;
graph<myVertexSpecy,myEdgeSpecy> myGraph <- generate_watts_strogatz(
60,
1,
100,
true);
See also: generate_watts_strogatz,
-
bool
generate_complete_graph
list
--->graph
-
generate_complete_graph
(bool
,list
) --->graph
-
int
generate_complete_graph
bool
--->graph
-
generate_complete_graph
(int
,bool
) --->graph
-
generate_complete_graph
(bool
,list
,species
) --->graph
-
generate_complete_graph
(int
,bool
,species
) --->graph
-
generate_complete_graph
(int
,bool
,species
,species
) --->graph
returns a fully connected graph.
-
nbNodes
: number of nodes to create;directed
: is the graph directed or not;node_species
: the species of nodes;edges_species
: the species of edges
graph<myVertexSpecy,myEdgeSpecy> myGraph <- generate_complete_graph(
100,
true,
node_species,
edge_species);
- "directed": is the graph has to be directed or not;"nodes": the list of existing nodes
graph<myVertexSpecy,myEdgeSpecy> myGraph <- generate_complete_graph(
true,
nodes);
- "directed": is the graph has to be directed or not;"nodes": the list of existing nodes; "edges_species": the species of edges
graph<myVertexSpecy,myEdgeSpecy> myGraph <- generate_complete_graph(
true,
nodes,
edge_species);
-
nbNodes
: number of nodes to create;directed
: is the graph directed or not;node_species
: the species of nodes
graph myGraph <- generate_complete_graph(
100,
true,
node_species);
-
nbNodes
: number of nodes to create;directed
: is the graph directed or not
graph myGraph <- generate_complete_graph(
100,
true);
See also: generate_barabasi_albert, generate_watts_strogatz,
-
generate_pedestrian_network
(list<container<unknown,geometry>>
,container<unknown,geometry>
,bool
,bool
,float
,float
,bool
,float
,float
,float
,float
) --->list<geometry>
-
generate_pedestrian_network
(list<container<unknown,geometry>>
,container<unknown,geometry>
,bool
,bool
,float
,float
,bool
,float
,float
,float
,float
,float
) --->list<geometry>
-
generate_pedestrian_network
(list<container<unknown,geometry>>
,container<unknown,geometry>
,container<unknown,geometry>
,bool
,bool
,float
,float
,bool
,float
,float
,float
,float
) --->list<geometry>
-
generate_pedestrian_network
(list<container<unknown,geometry>>
,container<unknown,geometry>
,container<unknown,geometry>
,bool
,bool
,float
,float
,bool
,float
,float
,float
,float
,float
) --->list<geometry>
The method allows to build a network of corridors to be used by pedestrian while traveling around a space made of obstacles and other users. It makes it possible to avoide collision with other agents (e.g. buildings) including other pedestrians and in the same time managing a path to a destination in a complex environment (e.g. a city). The method is highly customizable, with many parameters listed as below:
- obstacles : a list containing the lists of geometries or agents that are obstacles for pedestrians (e.g. walls, cars).
- bounds : a list of geometries that represent the spatial boundary of the network (i.e. the enclosing space of the network).
- open : a boolean expression that will add nodes in the network within open areas. More precisely, new invisible points are added to improve triangulation in areas with very few obstacles.
- randomDist : a boolean expression, related to the previous 'open' parameter, that allows to switch between a random (true) spatial distribution or a distribution (false) that build upon a equidistant repartition of points all around the area.
- open area : a float in meters representing the minimum distance for an area to be considered as an open area (i.e. euclidian distance between centroid and farest obstacle)
- density point : a float representing the density of points per meter within open areas.
- clean network : a boolean expression that allows to enhance the network (true) or living as it is generated (false). Enhancement includes filling very small gaps between edges and nodes.
- cliping : tolerance for the cliping in triangulation (float; distance) - see skeletonize operator
- tolerance : tolerance for the triangulation (float)
- min dist obstacle : minimal distance to obstacles to keep a path (float; if 0.0, no filtering)
- simplification : simplification distance for the final geometries
- square size : size of squares for decomposition (optimization)
- The method allows to build a network of corridors to be used by pedestrian while traveling around a space made of obstacles and other users. It makes it possible to avoide collision with other agents (e.g. buildings) including other pedestrians and in the same time managing a path to a destination in a complex environment (e.g. a city). The method is highly customizable, with many parameters listed as below:
- obstacles : a list containing the lists of geometries or agents that are obstacles for pedestrians (e.g. walls, cars).
- bounds : a list of geometries that represent the spatial boundary of the network (i.e. the enclosing space of the network).
- open : a boolean expression that will add nodes in the network within open areas. More precisely, new invisible points are added to improve triangulation in areas with very few obstacles.
- randomDist : a boolean expression, related to the previous 'open' parameter, that allows to switch between a random (true) spatial distribution or a distribution (false) that build upon a equidistant repartition of points all around the area.
- open area : a float in meters representing the minimum distance for an area to be considered as an open area (i.e. euclidian distance between centroid and farest obstacle)
- density point : a float representing the density of points per meter within open areas.
- clean network : a boolean expression that allows to enhance the network (true) or living as it is generated (false). Enhancement includes filling very small gaps between edges and nodes.
- cliping : tolerance for the cliping in triangulation (float; distance) - see skeletonize operator
- tolerance : tolerance for the triangulation (float)
- min dist obstacle : minimal distance to obstacles to keep a path (float; if 0.0, no filtering)
- simplification : simplification distance for the final geometries
- The method allows to build a network of corridors to be used by pedestrian while traveling around a space made of obstacles and other users. It makes it possible to avoide collision with other agents (e.g. buildings) including other pedestrians and in the same time managing a path to a destination in a complex environment (e.g. a city). The method is highly customizable, with many parameters listed as below:
- obstacles : a list containing the lists of geometries or agents that are obstacles for pedestrians (e.g. walls, cars).
- bounds : a list of geometries that represent the spatial boundary of the network (i.e. the enclosing space of the network).
- regular network : allows to combine the generated network with a simplified car user oriented network. More specifically, the network generated will combine enhance pedestrian oriented generated network with the given network: The property of the latter does not allows pedestrian to avoid collision (1D) when using its edges (while moving in 2D space and avoiding collision in the former).
- open : a boolean expression that will add nodes in the network within open areas. More precisely, new invisible points are added to improve triangulation in areas with very few obstacles.
- randomDist : a boolean expression, related to the previous 'open' parameter, that allows to switch between a random (true) spatial distribution or a distribution (false) that build upon a equidistant repartition of points all around the area.
- open area : a float in meters representing the minimum distance for an area to be considered as an open area (i.e. euclidian distance between centroid and farest obstacle)
- density point : a float representing the density of points per meter within open areas.
- clean network : a boolean expression that allows to enhance the network (true) or living as it is generated (false). Enhancement includes filling very small gaps between edges and nodes.
- cliping : tolerance for the cliping in triangulation (float; distance) - see skeletonize operator
- tolerance : tolerance for the triangulation (float)
- min dist obstacle : minimal distance to obstacles to keep a path (float; if 0.0, no filtering)
- The method allows to build a network of corridors to be used by pedestrian while traveling around a space made of obstacles and other users. It makes it possible to avoide collision with other agents (e.g. buildings) including other pedestrians and in the same time managing a path to a destination in a complex environment (e.g. a city). The method is highly customizable, with many parameters listed as below:
- obstacles : a list containing the lists of geometries or agents that are obstacles for pedestrians (e.g. walls, cars).
- bounds : a list of geometries that represent the spatial boundary of the network (i.e. the enclosing space of the network).
- regular network : allows to combine the generated network with a simplified car user oriented network. More specifically, the network generated will combine enhance pedestrian oriented generated network with the given network: The property of the latter does not allows pedestrian to avoid collision (1D) when using its edges (while moving in 2D space and avoiding collision in the former).
- open : a boolean expression that will add nodes in the network within open areas. More precisely, new invisible points are added to improve triangulation in areas with very few obstacles.
- randomDist : a boolean expression, related to the previous 'open' parameter, that allows to switch between a random (true) spatial distribution or a distribution (false) that build upon a equidistant repartition of points all around the area.
- open area : a float in meters representing the minimum distance for an area to be considered as an open area (i.e. euclidian distance between centroid and farest obstacle)
- density point : a float representing the density of points per meter within open areas.
- clean network : a boolean expression that allows to enhance the network (true) or living as it is generated (false). Enhancement includes filling very small gaps between edges and nodes.
- cliping : tolerance for the cliping in triangulation (float; distance) - see skeletonize operator
- tolerance : tolerance for the triangulation (float)
- min dist obstacle : minimal distance to obstacles to keep a path (float; if 0.0, no filtering)
- simplification : simplification distance for the final geometries
list<geometry> var0 <- generate_pedestrian_network([wall], [world],true,false,3.0,0.1, true,0.1,0.0,0.0,0.0,50.0); // var0 equals a list of polylines corresponding to the pedestrian paths
list<geometry> var1 <- generate_pedestrian_network([wall], [world],true,false,3.0,0.1, true,0.1,0.0,0.0,0.0,0.0); // var1 equals a list of polylines corresponding to the pedestrian paths
list<geometry> var2 <- generate_pedestrian_network([wall], [world], [road], true,false,3.0,0.1, true,0.1,0.0,0.0,0.0); // var2 equals a list of polylines corresponding to the pedestrian paths
list<geometry> var3 <- generate_pedestrian_network([wall], [world], [road], true,false,3.0,0.1, true,0.1,0.0,0.0,0.0,50.0); // var3 equals a list of polylines corresponding to the pedestrian paths
-
generate_random_graph
(int
,int
,bool
) --->graph
-
generate_random_graph
(int
,int
,bool
,species
) --->graph
-
generate_random_graph
(int
,int
,bool
,species
,species
) --->graph
returns a random graph.
-
nbNodes
: number of nodes to be created;nbEdges
: number of edges to be created;directed
: is the graph has to be directed or not;node_species
: the species of nodes;edges_species
: the species of edges
graph<node_species,edge_species> myGraph <- generate_random_graph(
50,
100,
true,
node_species,
edge_species);
-
nbNodes
: number of nodes to create;nbEdges
: number of edges to create;directed
: is the graph directed or not
graph myGraph <- generate_random_graph(
50,
100,
true);
-
nbNodes
: number of nodes to create;nbEdges
: number of edges to create;directed
: is the graph directed or not;node_species
: the species of nodes
graph myGraph <- generate_random_graph(
50,
100,
true,
node_species);
See also: generate_barabasi_albert, generate_watts_strogatz,
-
generate_terrain
(int
,int
,int
,float
,float
,float
) --->field
This operator allows to generate a pseudo-terrain using a simplex noise generator. Its usage is kept simple: it takes first a seed (random or not), then the dimensions (width and height) of the field to generate, then a level (between 0 and 1) of details (which actually determines the number of passes to make), then the value (between 0 and 1) of smoothess, with 0 being completely rought and 1 super smooth, and finally the value (between 0 and 1) of scattering, with 0 building maps in 'one piece' and 1 completely scattered ones.
-
generate_watts_strogatz
(container
,float
,int
,bool
) --->graph
-
generate_watts_strogatz
(int
,float
,int
,bool
) --->graph
-
generate_watts_strogatz
(int
,float
,int
,bool
,species
) --->graph
-
generate_watts_strogatz
(int
,float
,int
,bool
,species
,species
) --->graph
returns a random small-world network (following Watts-Strogatz model).
The Watts-Strogatz model is a random graph generation model that produces graphs with small-world properties, including short average path lengths and high clustering.A small-world network is a type of graph in which most nodes are not neighbors of one another, but most nodes can be reached from every other by a small number of hops or steps. [From Wikipedia article]The map operand should includes following elements:The Watts-Strogatz model is a random graph generation model that produces graphs with small-world properties, including short average path lengths and high clustering.A small-world network is a type of graph in which most nodes are not neighbors of one another, but most nodes can be reached from every other by a small number of hops or steps. [From Wikipedia article]The map operand should includes following elements:The Watts-Strogatz model is a random graph generation model that produces graphs with small-world properties, including short average path lengths and high clustering.A small-world network is a type of graph in which most nodes are not neighbors of one another, but most nodes can be reached from every other by a small number of hops or steps. [From Wikipedia article]The map operand should includes following elements:The Watts-Strogatz model is a random graph generation model that produces graphs with small-world properties, including short average path lengths and high clustering.A small-world network is a type of graph in which most nodes are not neighbors of one another, but most nodes can be reached from every other by a small number of hops or steps. [From Wikipedia article]The map operand should includes following elements:
- "nbNodes": the graph will contain (size + 1) nodes (size must be greater than k); "p": probability to "rewire" an edge (so it must be between 0 and 1, the parameter is often called beta in the literature); "k": the base degree of each node (k must be greater than 2 and even); "directed": is the graph directed or not; "node_species": the species of vertices
graph<myVertexSpecy,myEdgeSpecy> myGraph <- generate_watts_strogatz(
100,
0.3,
5,
true,
myVertexSpecies);
- "nodes": the list of nodes to connect; "p": probability to "rewire" an edge (so it must be between 0 and 1, the parameter is often called beta in the literature); "k": the base degree of each node (k must be greater than 2 and even); "directed": is the graph directed or not
graph<myVertexSpecy,myEdgeSpecy> myGraph <- generate_watts_strogatz(
people,
0.3,
5,
true);
- "nbNodes": the graph will contain (size + 1) nodes (size must be greater than k); "p": probability to "rewire" an edge (so it must be between 0 and 1, the parameter is often called beta in the literature); "k": the base degree of each node (k must be greater than 2 and even); "directed": is the graph directed or not; "node_species": the species of vertices; "edges_species": the species of edges
graph<myVertexSpecy,myEdgeSpecy> myGraph <- generate_watts_strogatz(
100,
0.3,
5,
true,
myVertexSpecies,
myEdgeSpecies);
- "nbNodes": the graph will contain (size + 1) nodes (size must be greater than k); "p": probability to "rewire" an edge (so it must be between 0 and 1, the parameter is often called beta in the literature); "k": the base degree of each node (k must be greater than 2 and even); "directed": is the graph directed or not
graph<myVertexSpecy,myEdgeSpecy> myGraph <- generate_watts_strogatz(
100,
0.3,
5,
true);
See also: generate_barabasi_albert,
-
geojson_file
(string
) --->file
-
string
geojson_file
int
--->file
-
geojson_file
(string
,int
) --->file
-
string
geojson_file
string
--->file
-
geojson_file
(string
,string
) --->file
-
string
geojson_file
bool
--->file
-
geojson_file
(string
,bool
) --->file
-
geojson_file
(string
,int
,bool
) --->file
-
geojson_file
(string
,string
,bool
) --->file
Constructs a file of type geojson. Allowed extensions are limited to json, geojson, geo.json
- geojson_file(string): This file constructor allows to read a geojson file (https://geojson.org/)
file f <- geojson_file("file.json");
- geojson_file(string,int): This file constructor allows to read a geojson file and specifying the coordinates system code, as an int
file f <- geojson_file("file.json", 32648);
- geojson_file(string,string): This file constructor allows to read a geojson file and specifying the coordinates system code (epg,...,), as a string
file f <- geojson_file("file.json", "EPSG:32648");
- geojson_file(string,bool): This file constructor allows to read a geojson file and take a potential z value (not taken in account by default)
file f <- geojson_file("file.json", true);
- geojson_file(string,int,bool): This file constructor allows to read a geojson file, specifying the coordinates system code, as an int and take a potential z value (not taken in account by default)
file f <- geojson_file("file.json",32648, true);
- geojson_file(string,string,bool): This file constructor allows to read a geojson file, specifying the coordinates system code (epg,...,), as a string and take a potential z value (not taken in account by default
file f <- geojson_file("file.json", "EPSG:32648",true);
See also: is_geojson,
-
geometric_mean
(container
) --->float
the geometric mean of the elements of the operand. See Geometric_mean for more details.
The operator casts all the numerical element of the list into float. The elements that are not numerical are discarded.
float var0 <- geometric_mean ([4.5, 3.5, 5.5, 7.0]); // var0 equals 4.962326343467649
See also: mean, median, harmonic_mean,
-
geometry
(any
) --->geometry
casts the operand in a geometry object.
-
geometry_collection
(container<unknown,geometry>
) --->geometry
A geometry collection (multi-geometry) composed of the given list of geometries.
- if the operand is nil, returns the point geometry {0,0}
- if the operand is composed of a single geometry, returns a copy of the geometry.
geometry var0 <- geometry_collection([{0,0}, {0,10}, {10,10}, {10,0}]); // var0 equals a geometry composed of the 4 points (multi-point).
See also: around, circle, cone, link, norm, point, polygone, rectangle, square, triangle, line,
-
agent
get
string
--->unknown
-
get
(agent
,string
) --->unknown
-
geometry
get
string
--->unknown
-
get
(geometry
,string
) --->unknown
Reads an attribute of the specified agent (or geometry) (left operand). The attribute name is specified by the right operand.
- Reading the attribute of another agent
string agent_name <- an_agent get('name'); // reads then 'name' attribute of an_agent then assigns the returned value to the agent_name variable
- Reading the attribute of a geometry
string geom_area <- a_geometry get('area'); // reads then 'area' attribute of 'a_geometry' variable then assigns the returned value to the geom_area variable
-
get_about
(emotion
) --->predicate
get the about value of the given emotion
get_about(emotion)
-
get_agent
(social_link
) --->agent
get the agent value of the given social link
get_agent(social_link1)
-
get_agent_cause
(emotion
) --->agent
-
get_agent_cause
(predicate
) --->agent
get the agent cause value of the given emotion evaluate the agent_cause value of a predicate
get_agent_cause(emotion)
get_agent_cause(pred1)
-
agent
get_belief_op
predicate
--->mental_state
-
get_belief_op
(agent
,predicate
) --->mental_state
get the belief in the belief base with the given predicate.
mental_state var0 <- get_belief_op(self,predicate("has_water")); // var0 equals nil
-
agent
get_belief_with_name_op
string
--->mental_state
-
get_belief_with_name_op
(agent
,string
) --->mental_state
get the belief in the belief base with the given name.
mental_state var0 <- get_belief_with_name_op(self,"has_water"); // var0 equals nil
-
agent
get_beliefs_op
predicate
--->list<mental_state>
-
get_beliefs_op
(agent
,predicate
) --->list<mental_state>
get the beliefs in the belief base with the given predicate.
get_beliefs_op(self,predicate("has_water"))
-
agent
get_beliefs_with_name_op
string
--->list<mental_state>
-
get_beliefs_with_name_op
(agent
,string
) --->list<mental_state>
get the list of beliefs in the belief base which predicate has the given name.
get_beliefs_with_name_op(self,"has_water")
-
get_current_intention_op
(agent
) --->mental_state
get the current intention.
mental_state var0 <- get_current_intention_op(self); // var0 equals nil
-
get_decay
(emotion
) --->float
get the decay value of the given emotion
get_decay(emotion)
-
agent
get_desire_op
predicate
--->mental_state
-
get_desire_op
(agent
,predicate
) --->mental_state
get the desire in the desire base with the given predicate.
mental_state var0 <- get_belief_op(self,predicate("has_water")); // var0 equals nil
-
agent
get_desire_with_name_op
string
--->mental_state
-
get_desire_with_name_op
(agent
,string
) --->mental_state
get the desire in the desire base with the given name.
mental_state var0 <- get_desire_with_name_op(self,"has_water"); // var0 equals nil
-
agent
get_desires_op
predicate
--->list<mental_state>
-
get_desires_op
(agent
,predicate
) --->list<mental_state>
get the desires in the desire base with the given predicate.
get_desires_op(self,predicate("has_water"))
-
agent
get_desires_with_name_op
string
--->list<mental_state>
-
get_desires_with_name_op
(agent
,string
) --->list<mental_state>
get the list of desires in the desire base which predicate has the given name.
get_desires_with_name_op(self,"has_water")
-
get_dominance
(social_link
) --->float
get the dominance value of the given social link
get_dominance(social_link1)
-
get_familiarity
(social_link
) --->float
get the familiarity value of the given social link
get_familiarity(social_link1)
-
agent
get_ideal_op
predicate
--->mental_state
-
get_ideal_op
(agent
,predicate
) --->mental_state
get the ideal in the ideal base with the given name.
mental_state var0 <- get_ideal_op(self,predicate("has_water")); // var0 equals nil
-
agent
get_ideal_with_name_op
string
--->mental_state
-
get_ideal_with_name_op
(agent
,string
) --->mental_state
get the ideal in the ideal base with the given name.
mental_state var0 <- get_ideal_with_name_op(self,"has_water"); // var0 equals nil
-
agent
get_ideals_op
predicate
--->list<mental_state>
-
get_ideals_op
(agent
,predicate
) --->list<mental_state>
get the ideal in the ideal base with the given name.
get_ideals_op(self,predicate("has_water"))
-
agent
get_ideals_with_name_op
string
--->list<mental_state>
-
get_ideals_with_name_op
(agent
,string
) --->list<mental_state>
get the list of ideals in the ideal base which predicate has the given name.
get_ideals_with_name_op(self,"has_water")
-
get_intensity
(emotion
) --->float
get the intensity value of the given emotion
get_intensity(emo1)
-
agent
get_intention_op
predicate
--->mental_state
-
get_intention_op
(agent
,predicate
) --->mental_state
get the intention in the intention base with the given predicate.
get_intention_op(self,predicate("has_water"))
-
agent
get_intention_with_name_op
string
--->mental_state
-
get_intention_with_name_op
(agent
,string
) --->mental_state
get the intention in the intention base with the given name.
get_intention_with_name_op(self,"has_water")
-
agent
get_intentions_op
predicate
--->list<mental_state>
-
get_intentions_op
(agent
,predicate
) --->list<mental_state>
get the intentions in the intention base with the given predicate.
get_intentions_op(self,predicate("has_water"))
-
agent
get_intentions_with_name_op
string
--->list<mental_state>
-
get_intentions_with_name_op
(agent
,string
) --->list<mental_state>
get the list of intentions in the intention base which predicate has the given name.
get_intentions_with_name_op(self,"has_water")
-
get_lifetime
(mental_state
) --->int
get the lifetime value of the given mental state
get_lifetime(mental_state1)
-
get_liking
(social_link
) --->float
get the liking value of the given social link
get_liking(social_link1)
-
get_modality
(mental_state
) --->string
get the modality value of the given mental state
get_modality(mental_state1)
-
agent
get_obligation_op
predicate
--->mental_state
-
get_obligation_op
(agent
,predicate
) --->mental_state
get the obligation in the obligation base with the given predicate.
mental_state var0 <- get_obligation_op(self,predicate("has_water")); // var0 equals nil
-
agent
get_obligation_with_name_op
string
--->mental_state
-
get_obligation_with_name_op
(agent
,string
) --->mental_state
get the obligation in the obligation base with the given name.
mental_state var0 <- get_obligation_with_name_op(self,"has_water"); // var0 equals nil
-
agent
get_obligations_op
predicate
--->list<mental_state>
-
get_obligations_op
(agent
,predicate
) --->list<mental_state>
get the obligations in the obligation base with the given predicate.
get_obligations_op(self,predicate("has_water"))
-
agent
get_obligations_with_name_op
string
--->list<mental_state>
-
get_obligations_with_name_op
(agent
,string
) --->list<mental_state>
get the list of obligations in the obligation base which predicate has the given name.
get_obligations_with_name_op(self,"has_water")
-
get_plan_name
(BDIPlan
) --->string
get the name of a given plan
get_plan_name(agent.current_plan)
-
get_predicate
(mental_state
) --->predicate
get the predicate value of the given mental state
get_predicate(mental_state1)
-
get_solidarity
(social_link
) --->float
get the solidarity value of the given social link
get_solidarity(social_link1)
-
get_strength
(mental_state
) --->float
get the strength value of the given mental state
get_strength(mental_state1)
-
get_super_intention
(predicate
) --->mental_state
get the super intention linked to a mental state
get_super_intention(get_belief(pred1))
-
get_trust
(social_link
) --->float
get the familiarity value of the given social link
get_familiarity(social_link1)
-
get_truth
(predicate
) --->bool
evaluate the truth value of a predicate
get_truth(pred1)
-
agent
get_uncertainties_op
predicate
--->list<mental_state>
-
get_uncertainties_op
(agent
,predicate
) --->list<mental_state>
get the uncertainties in the uncertainty base with the given predicate.
get_uncertainties_op(self,predicate("has_water"))
-
agent
get_uncertainties_with_name_op
string
--->list<mental_state>
-
get_uncertainties_with_name_op
(agent
,string
) --->list<mental_state>
get the list of uncertainties in the uncertainty base which predicate has the given name.
get_uncertainties_with_name_op(self,"has_water")
-
agent
get_uncertainty_op
predicate
--->mental_state
-
get_uncertainty_op
(agent
,predicate
) --->mental_state
get the uncertainty in the uncertainty base with the given predicate.
mental_state var0 <- get_uncertainty_op(self,predicate("has_water")); // var0 equals nil
-
agent
get_uncertainty_with_name_op
string
--->mental_state
-
get_uncertainty_with_name_op
(agent
,string
) --->mental_state
get the uncertainty in the uncertainty base with the given name.
mental_state var0 <- get_uncertainty_with_name_op(self,"has_water"); // var0 equals nil
-
get_values
(predicate
) --->map<string,unknown>
return the map values of a predicate
get_values(pred1)
-
gif_file
(string
) --->file
-
string
gif_file
matrix<int>
--->file
-
gif_file
(string
,matrix<int>
) --->file
Constructs a file of type gif. Allowed extensions are limited to gif
- gif_file(string): This file constructor allows to read a gif file
gif_file f <- gif_file("file.gif");
- gif_file(string,matrix): This file constructor allows to store a matrix in a gif file (it does not save it - just store it in memory)
gif_file f <- gif_file("file.gif",matrix([10,10],[10,10]));
See also: is_gif,
-
gini
(list<float>
) --->float
- return the Gini Index of the given list of values (list of floats)
float var0 <- gini([1.0, 0.5, 2.0]); // var0 equals the gini index computed i.e. 0.2857143
-
graph
girvan_newman_clustering
int
--->list
-
girvan_newman_clustering
(graph
,int
) --->list
The Girvan�Newman algorithm is a hierarchical method used to detect communities. It detects communities by progressively removing edges from the original network.It returns a list of list of vertices and takes as operand the graph and the number of clusters
-
gml_file
(string
) --->file
-
string
gml_file
int
--->file
-
gml_file
(string
,int
) --->file
-
string
gml_file
string
--->file
-
gml_file
(string
,string
) --->file
-
string
gml_file
bool
--->file
-
gml_file
(string
,bool
) --->file
-
gml_file
(string
,int
,bool
) --->file
-
gml_file
(string
,string
,bool
) --->file
Constructs a file of type gml. Allowed extensions are limited to gml
- gml_file(string): This file constructor allows to read a gml file
file f <- gml_file("file.gml");
- gml_file(string,int): This file constructor allows to read a gml file and specifying the coordinates system code, as an int (epsg code)
file f <- gml_file("file.gml", 32648);
- gml_file(string,string): This file constructor allows to read a gml file and specifying the coordinates system code (epg,...,), as a string
file f <- gml_file("file.gml", "EPSG:32648");
- gml_file(string,bool): This file constructor allows to read a gml file and take a potential z value (not taken in account by default)
file f <- gml_file("file.gml", true);
- gml_file(string,int,bool): This file constructor allows to read a gml file, specifying the coordinates system code, as an int (epsg code) and take a potential z value (not taken in account by default)
file f <- gml_file("file.gml", 32648, true);
- gml_file(string,string,bool): This file constructor allows to read a gml file, specifying the coordinates system code (epg,...,), as a string and take a potential z value (not taken in account by default
file f <- gml_file("file.gml", "EPSG:32648",true);
See also: is_gml,
-
gradient
(list<rgb>
) --->map<rgb,float>
-
gradient
(map<rgb,float>
) --->map<rgb,float>
-
rgb
gradient
rgb
--->map<rgb,float>
-
gradient
(rgb
,rgb
) --->map<rgb,float>
-
gradient
(rgb
,rgb
,float
) --->map<rgb,float>
returns the definition of a linear gradient between two colors, with a ratio (between 0 and 1, otherwise clamped) represented internally as a color map [start::0.0,(startr+stop(1-r))::r, stop::1.0] returns the definition of a linear gradient between n colors, represented internally as a color map [c1::0,c2::1/n-1, ... cn::n-1/n-1] returns the definition of a linear gradient between two colors, represented internally as a color map [start::0.0,stop::1.0] returns the definition of a linear gradient between n colors provided with their positions on a scale between 0 and 1. A similar color map is returned, in the same color order, with all the positions normalized (so that they are shifted and scaled to fit between 0 and 1). Throws an error if the number of colors is less than 2 or if the positions are not strictly ordered
-
graph
(any
) --->graph
casts the operand in a graph object.
-
graph6_file
(string
) --->file
-
string
graph6_file
species
--->file
-
graph6_file
(string
,species
) --->file
-
graph6_file
(string
,species
,species
) --->file
Constructs a file of type graph6. Allowed extensions are limited to graph6
- graph6_file(string): References a graph6 file by its filename
- graph6_file(string,species): References a graph6 file by its filename and the species to use to instantiate the nodes
- graph6_file(string,species,species): References a graph6 file by its filename and the species to use to instantiate the nodes and the edges
See also: is_graph6,
-
graphdimacs_file
(string
) --->file
-
string
graphdimacs_file
species
--->file
-
graphdimacs_file
(string
,species
) --->file
-
graphdimacs_file
(string
,species
,species
) --->file
Constructs a file of type graphdimacs. Allowed extensions are limited to dimacs
- graphdimacs_file(string): References a dimacs file by its filename
- graphdimacs_file(string,species): References a dimacs file by its filename and the species to use to instantiate the nodes
- graphdimacs_file(string,species,species): References a dimacs file by its filename and the species to use to instantiate the nodes and the edges
See also: is_graphdimacs,
-
graphdot_file
(string
) --->file
-
string
graphdot_file
species
--->file
-
graphdot_file
(string
,species
) --->file
-
graphdot_file
(string
,species
,species
) --->file
Constructs a file of type graphdot. Allowed extensions are limited to dot
- graphdot_file(string): References a dot graph file by its filename
- graphdot_file(string,species): References a dot graph file by its filename and the species to use to instantiate the nodes
- graphdot_file(string,species,species): References a dot graph file by its filename and the 2 species to use to instantiate the nodes and the edges
See also: is_graphdot,
-
graphgexf_file
(string
) --->file
-
string
graphgexf_file
species
--->file
-
graphgexf_file
(string
,species
) --->file
-
graphgexf_file
(string
,species
,species
) --->file
Constructs a file of type graphgexf. Allowed extensions are limited to gexf
- graphgexf_file(string): References a gexf graph file by its filename
- graphgexf_file(string,species): References a gexf graph file by its filename and the species to use to instantiate the nodes
- graphgexf_file(string,species,species): References a gexf graph file by its filename and the 2 species to use to instantiate the nodes and the edges
See also: is_graphgexf,
-
graphgml_file
(string
) --->file
-
string
graphgml_file
species
--->file
-
graphgml_file
(string
,species
) --->file
-
graphgml_file
(string
,species
,species
) --->file
Constructs a file of type graphgml. Allowed extensions are limited to gml
- graphgml_file(string): References a gml graph file by its filename
- graphgml_file(string,species): References a gml graph file by its filename and the species to use to instantiate the nodes
- graphgml_file(string,species,species): References a gml graph file by its filename and the 2 species to use to instantiate the nodes and the edges
See also: is_graphgml,
-
graphml_file
(string
) --->file
-
string
graphml_file
species
--->file
-
graphml_file
(string
,species
) --->file
-
graphml_file
(string
,species
,species
) --->file
-
graphml_file
(string
,species
,species
,string
,string
) --->file
Constructs a file of type graphml. Allowed extensions are limited to graphml
- graphml_file(string): References a graphml graph file by its filename
- graphml_file(string,species): References a graphml graph file by its filename and the species to use to instantiate the nodes
- graphml_file(string,species,species): References a graphml graph file by its filename and the 2 species to use to instantiate the nodes and the edges
- graphml_file(string,species,species,string,string): References a graphml graph file by its filename and the 2 species to use to instantiate the nodes and the edges
See also: is_graphml,
-
graphtsplib_file
(string
) --->file
-
string
graphtsplib_file
species
--->file
-
graphtsplib_file
(string
,species
) --->file
-
graphtsplib_file
(string
,species
,species
) --->file
Constructs a file of type graphtsplib. Allowed extensions are limited to tsplib
- graphtsplib_file(string): References a tsplib graph file by its filename
- graphtsplib_file(string,species): References a tsplib graph file by its filename and the species to use to instantiate the nodes
- graphtsplib_file(string,species,species): References a tsplib graph file by its filename and the 2 species to use to instantiate the nodes and the edges
See also: is_graphtsplib,
-
grayscale
(rgb
) --->rgb
Converts rgb color to grayscale value
r=red, g=green, b=blue. Between 0 and 255 and gray = 0.299 *
red + 0.587 *
green + 0.114 *
blue (Photoshop value)
rgb var0 <- grayscale (rgb(255,0,0)); // var0 equals to a dark grey
-
grayscale
(image
) --->image
Used to convert any image to a grayscale color palette and return it. The original image is left untouched
-
species
grid_at
point
--->agent
-
grid_at
(species
,point
) --->agent
returns the cell of the grid (right-hand operand) at the position given by the right-hand operand
If the left-hand operand is a point of floats, it is used as a point of ints.
- if the left-hand operand is not a grid cell species, returns nil
agent var0 <- grid_cell grid_at {1,2}; // var0 equals the agent grid_cell with grid_x=1 and grid_y = 2
-
grid_cells_to_graph
(container
) --->graph
-
container
grid_cells_to_graph
species
--->graph
-
grid_cells_to_graph
(container
,species
) --->graph
creates a graph from a list of cells (operand). An edge is created between neighbors.
my_cell_graph <- grid_cells_to_graph(cells_list);
See also: as_intersection_graph, as_edge_graph,
-
grid_file
(string
) --->file
-
string
grid_file
bool
--->file
-
grid_file
(string
,bool
) --->file
-
string
grid_file
int
--->file
-
grid_file
(string
,int
) --->file
-
string
grid_file
string
--->file
-
grid_file
(string
,string
) --->file
-
string
grid_file
field
--->file
-
grid_file
(string
,field
) --->file
Constructs a file of type grid. Allowed extensions are limited to asc, tif
- grid_file(string): This file constructor allows to read a asc file or a tif (geotif) file
file f <- grid_file("file.asc");
- grid_file(string,bool): This file constructor allows to read a asc file or a tif (geotif) file, but without converting it into shapes. Only a matrix of float values is created
file f <- grid_file("file.asc", false);
- grid_file(string,int): This file constructor allows to read a asc file or a tif (geotif) file specifying the coordinates system code, as an int (epsg code)
file f <- grid_file("file.asc", 32648);
- grid_file(string,string): This file constructor allows to read a asc file or a tif (geotif) file specifying the coordinates system code (epg,...,), as a string
file f <- grid_file("file.asc","EPSG:32648");
- grid_file(string,field): This allows to build a writable grid file from the values of a field
file f <- grid_file("file.tif",my_field); save f;
See also: is_grid,
-
container
group_by
any expression
--->map
-
group_by
(container
,any expression
) --->map
Returns a map, where the keys take the possible values of the right-hand operand and the map values are the list of elements of the left-hand operand associated to the key value
in the right-hand operand, the keyword each can be used to represent, in turn, each of the right-hand operand elements.
- if the left-hand operand is nil, group_by throws an error
map var0 <- [1,2,3,4,5,6,7,8] group_by (each > 3); // var0 equals [false::[1, 2, 3], true::[4, 5, 6, 7, 8]]
map var1 <- g2 group_by (length(g2 out_edges_of each) ); // var1 equals [ 0::[node9, node7, node10, node8, node11], 1::[node6], 2::[node5], 3::[node4]]
map var2 <- (list(node) group_by (round(node(each).location.x)); // var2 equals [32::[node5], 21::[node1], 4::[node0], 66::[node2], 96::[node3]]
map<bool,list> var3 <- [1::2, 3::4, 5::6] group_by (each > 4); // var3 equals [false::[2, 4], true::[6]]
See also: first_with, last_with, where,
-
harmonic_mean
(container
) --->float
the harmonic mean of the elements of the operand. See Harmonic_mean for more details.
The operator casts all the numerical element of the list into float. The elements that are not numerical are discarded.
float var0 <- harmonic_mean ([4.5, 3.5, 5.5, 7.0]); // var0 equals 4.804159445407279
See also: mean, median, geometric_mean,
-
agent
has_belief_op
predicate
--->bool
-
has_belief_op
(agent
,predicate
) --->bool
indicates if there already is a belief about the given predicate.
bool var0 <- has_belief_op(self,predicate("has_water")); // var0 equals false
-
agent
has_belief_with_name_op
string
--->bool
-
has_belief_with_name_op
(agent
,string
) --->bool
indicates if there already is a belief about the given name.
bool var0 <- has_belief_with_name_op(self,"has_water"); // var0 equals false
-
agent
has_desire_op
predicate
--->bool
-
has_desire_op
(agent
,predicate
) --->bool
indicates if there already is a desire about the given predicate.
bool var0 <- has_desire_op(self,predicate("has_water")); // var0 equals false
-
agent
has_desire_with_name_op
string
--->bool
-
has_desire_with_name_op
(agent
,string
) --->bool
indicates if there already is a desire about the given name.
bool var0 <- has_desire_with_name_op(self,"has_water"); // var0 equals false
-
agent
has_ideal_op
predicate
--->bool
-
has_ideal_op
(agent
,predicate
) --->bool
indicates if there already is an ideal about the given predicate.
bool var0 <- has_ideal_op(self,predicate("has_water")); // var0 equals false
-
agent
has_ideal_with_name_op
string
--->bool
-
has_ideal_with_name_op
(agent
,string
) --->bool
indicates if there already is an ideal about the given name.
bool var0 <- has_ideal_with_name_op(self,"has_water"); // var0 equals false
-
agent
has_intention_op
predicate
--->bool
-
has_intention_op
(agent
,predicate
) --->bool
indicates if there already is an intention about the given predicate.
bool var0 <- has_intention_op(self,predicate("has_water")); // var0 equals false
-
agent
has_intention_with_name_op
string
--->bool
-
has_intention_with_name_op
(agent
,string
) --->bool
indicates if there already is an intention about the given name.
bool var0 <- has_intention_with_name_op(self,"has_water"); // var0 equals false
-
agent
has_obligation_op
predicate
--->bool
-
has_obligation_op
(agent
,predicate
) --->bool
indicates if there already is an obligation about the given predicate.
bool var0 <- has_obligation_op(self,predicate("has_water")); // var0 equals false
-
agent
has_obligation_with_name_op
string
--->bool
-
has_obligation_with_name_op
(agent
,string
) --->bool
indicates if there already is an obligation about the given name.
bool var0 <- has_obligation_with_name_op(self,"has_water"); // var0 equals false
-
agent
has_uncertainty_op
predicate
--->bool
-
has_uncertainty_op
(agent
,predicate
) --->bool
indicates if there already is an uncertainty about the given predicate.
bool var0 <- has_uncertainty_op(self,predicate("has_water")); // var0 equals false
-
agent
has_uncertainty_with_name_op
string
--->bool
-
has_uncertainty_with_name_op
(agent
,string
) --->bool
indicates if there already is an uncertainty about the given name.
bool var0 <- has_uncertainty_with_name_op(self,"has_water"); // var0 equals false
-
hexagon
(float
) --->geometry
-
hexagon
(point
) --->geometry
-
float
hexagon
float
--->geometry
-
hexagon
(float
,float
) --->geometry
A hexagon geometry which the given with and height
the center of the hexagon is by default the location of the current agent in which has been called this operator.
- returns nil if the operand is nil.
geometry var0 <- hexagon(10); // var0 equals a geometry as a hexagon of width of 10 and height of 10.
geometry var1 <- hexagon({10,5}); // var1 equals a geometry as a hexagon of width of 10 and height of 5.
geometry var2 <- hexagon(10,5); // var2 equals a geometry as a hexagon of width of 10 and height of 5.
See also: around, circle, cone, line, link, norm, point, polygon, polyline, rectangle, triangle,
-
container<unknown,agent>
hierarchical_clustering
float
--->list
-
hierarchical_clustering
(container<unknown,agent>
,float
) --->list
A tree (list of list) contained groups of agents clustered by distance considering a distance min between two groups.
use of hierarchical clustering with Minimum for linkage criterion between two groups of agents.
list var0 <- [ag1, ag2, ag3, ag4, ag5] hierarchical_clustering 20.0; // var0 equals for example, can return [[[ag1],[ag3]], [ag2], [[[ag4],[ag5]],[ag6]]
See also: simple_clustering_by_distance,
-
horizontal
(map<unknown,int>
) --->unknown<string>
Creates a horizontal layout node (a sash). Sashes can contain any number (> 1) of other elements: stacks, horizontal or vertical sashes, or display indices. Each element is represented by a pair in the map, where the key is the element and the value its weight within the sash
-
horizontal_flip
(image
) --->image
Returns an image flipped horizontally by reflecting the original image around the y axis. The original image is left untouched
-
hsb
(float
,float
,float
) --->rgb
-
hsb
(float
,float
,float
,int
) --->rgb
-
hsb
(float
,float
,float
,float
) --->rgb
Converts hsb (h=hue, s=saturation, b=brightness) value to Gama color
h,s and b components should be floating-point values between 0.0 and 1.0 and when used alpha should be an integer (between 0 and 255) or a float (between 0 and 1) . Examples: Red=(0.0,1.0,1.0), Yellow=(0.16,1.0,1.0), Green=(0.33,1.0,1.0), Cyan=(0.5,1.0,1.0), Blue=(0.66,1.0,1.0), Magenta=(0.83,1.0,1.0)
rgb var0 <- hsb (0.5,1.0,1.0,0.0); // var0 equals rgb("cyan",0)
rgb var1 <- hsb (0.0,1.0,1.0); // var1 equals rgb("red")
See also: rgb,
-
hypot
(float
,float
,float
,float
) --->float
Returns sqrt(x2 +y2) without intermediate overflow or underflow.
- If either argument is infinite, then the result is positive infinity. If either argument is NaN and neither argument is infinite, then the result is NaN.
float var0 <- hypot(0,1,0,1); // var0 equals sqrt(2)
- Installation and Launching
- Workspace, Projects and Models
- Editing Models
- Running Experiments
- Running Headless
- Preferences
- Troubleshooting
- Introduction
- Manipulate basic Species
- Global Species
- Defining Advanced Species
- Defining GUI Experiment
- Exploring Models
- Optimizing Model Section
- Multi-Paradigm Modeling
- Manipulate OSM Data
- Diffusion
- Using Database
- Using FIPA ACL
- Using BDI with BEN
- Using Driving Skill
- Manipulate dates
- Manipulate lights
- Using comodel
- Save and restore Simulations
- Using network
- Headless mode
- Using Headless
- Writing Unit Tests
- Ensure model's reproducibility
- Going further with extensions
- Built-in Species
- Built-in Skills
- Built-in Architecture
- Statements
- Data Type
- File Type
- Expressions
- Exhaustive list of GAMA Keywords
- Installing the GIT version
- Developing Extensions
- Introduction to GAMA Java API
- Using GAMA flags
- Creating a release of GAMA
- Documentation generation