Operators (S to Z)
This file is automatically generated from java files. Do Not Edit It.
Definition​
Operators in the GAML language are used to compose complex expressions. An operator performs a function on one, two, or n operands (which are other expressions and thus may be themselves composed of operators) and returns the result of this function.
Most of them use a classical prefixed functional syntax (i.e. operator_name(operand1, operand2, operand3)
, see below), with the exception of arithmetic (e.g. +
, /
), logical (and
, or
), comparison (e.g. >
, <
), access (.
, [..]
) and pair (::
) operators, which require an infixed notation (i.e. operand1 operator_symbol operand1
).
The ternary functional if-else operator, ? :
, uses a special infixed syntax composed with two symbols (e.g. operand1 ? operand2 : operand3
). Two unary operators (-
and !
) use a traditional prefixed syntax that does not require parentheses unless the operand is itself a complex expression (e.g. - 10
, ! (operand1 or operand2)
).
Finally, special constructor operators ({...}
for constructing points, [...]
for constructing lists and maps) will require their operands to be placed between their two symbols (e.g. {1,2,3}
, [operand1, operand2, ..., operandn]
or [key1::value1, key2::value2... keyn::valuen]
).
With the exception of these special cases above, the following rules apply to the syntax of operators:
- if they only have one operand, the functional prefixed syntax is mandatory (e.g.
operator_name(operand1)
) - if they have two arguments, either the functional prefixed syntax (e.g.
operator_name(operand1, operand2)
) or the infixed syntax (e.g.operand1 operator_name operand2
) can be used. - if they have more than two arguments, either the functional prefixed syntax (e.g.
operator_name(operand1, operand2, ..., operand)
) or a special infixed syntax with the first operand on the left-hand side of the operator name (e.g.operand1 operator_name(operand2, ..., operand)
) can be used.
All of these alternative syntaxes are completely equivalent.
Operators in GAML are purely functional, i.e. they are guaranteed to not have any side effects on their operands. For instance, the shuffle
operator, which randomizes the positions of elements in a list, does not modify its list operand but returns a new shuffled list.
Priority between operators​
The priority of operators determines, in the case of complex expressions composed of several operators, which one(s) will be evaluated first.
GAML follows in general the traditional priorities attributed to arithmetic, boolean, comparison operators, with some twists. Namely:
- the constructor operators, like
::
, used to compose pairs of operands, have the lowest priority of all operators (e.g.a > b :: b > c
will return a pair of boolean values, which means that the two comparisons are evaluated before the operator applies. Similarly,[a > 10, b > 5]
will return a list of boolean values. - it is followed by the
?:
operator, the functional if-else (e.g.a > b ? a + 10 : a - 10
will return the result of the if-else). - next are the logical operators,
and
andor
(e.g.a > b or b > c
will return the value of the test) - next are the comparison operators (i.e.
>
,<
,<=
,>=
,=
,!=
) - next the arithmetic operators in their logical order (multiplicative operators have a higher priority than additive operators)
- next the unary operators
-
and!
- next the access operators
.
and[]
(e.g.{1,2,3}.x > 20 + {4,5,6}.y
will return the result of the comparison between the x and y ordinates of the two points) - and finally the functional operators, which have the highest priority of all.
Using actions as operators​
Actions defined in species can be used as operators, provided they are called on the correct agent. The syntax is that of normal functional operators, but the agent that will perform the action must be added as the first operand.
For instance, if the following species is defined:
species spec1 {
int min(int x, int y) {
return x > y ? x : y;
}
}
Any agent instance of spec1 can use min
as an operator (if the action conflicts with an existing operator, a warning will be emitted). For instance, in the same model, the following line is perfectly acceptable:
global {
init {
create spec1;
spec1 my_agent <- spec1[0];
int the_min <- my_agent min(10,20); // or min(my_agent, 10, 20);
}
}
If the action doesn't have any operands, the syntax to use is my_agent the_action()
. Finally, if it does not return a value, it might still be used but is considering as returning a value of type unknown
(e.g. unknown result <- my_agent the_action(op1, op2);
).
Note that due to the fact that actions are written by modelers, the general functional contract is not respected in that case: actions might perfectly have side effects on their operands (including the agent).
Table of Contents​
Operators by categories​
3D​
box, cone3D, cube, cylinder, dem, hexagon, pyramid, set_z, sphere, teapot,
Arithmetic operators​
-, /, ^, *, +, abs, acos, asin, atan, atan2, ceil, cos, cos_rad, div, even, exp, fact, floor, hypot, is_finite, is_number, ln, log, mod, round, signum, sin, sin_rad, sqrt, tan, tan_rad, tanh, with_precision,
BDI​
add_values, and, eval_when, get_about, get_agent, get_agent_cause, get_belief_op, get_belief_with_name_op, get_beliefs_op, get_beliefs_with_name_op, get_current_intention_op, get_decay, get_desire_op, get_desire_with_name_op, get_desires_op, get_desires_with_name_op, get_dominance, get_familiarity, get_ideal_op, get_ideal_with_name_op, get_ideals_op, get_ideals_with_name_op, get_intensity, get_intention_op, get_intention_with_name_op, get_intentions_op, get_intentions_with_name_op, get_lifetime, get_liking, get_modality, get_obligation_op, get_obligation_with_name_op, get_obligations_op, get_obligations_with_name_op, get_plan_name, get_predicate, get_solidarity, get_strength, get_super_intention, get_trust, get_truth, get_uncertainties_op, get_uncertainties_with_name_op, get_uncertainty_op, get_uncertainty_with_name_op, get_values, has_belief_op, has_belief_with_name_op, has_desire_op, has_desire_with_name_op, has_ideal_op, has_ideal_with_name_op, has_intention_op, has_intention_with_name_op, has_obligation_op, has_obligation_with_name_op, has_uncertainty_op, has_uncertainty_with_name_op, new_emotion, new_mental_state, new_predicate, new_social_link, not, or, set_about, set_agent, set_agent_cause, set_decay, set_dominance, set_familiarity, set_intensity, set_lifetime, set_liking, set_modality, set_predicate, set_solidarity, set_strength, set_trust, set_truth, with_values,
Casting operators​
as, as_int, as_matrix, font, is, is_skill, list_with, matrix_with, species, to_gaml, topology,
Color-related operators​
-, /, *, +, blend, brewer_colors, brewer_palettes, grayscale, hsb, mean, median, rgb, rnd_color, sum,
Comparison operators​
Containers-related operators​
-, ::, +, accumulate, all_match, among, at, collect, contains, contains_all, contains_any, contains_key, count, distinct, empty, every, first, first_with, get, group_by, in, index_by, inter, interleave, internal_at, 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, reverse, shuffle, sort_by, split, split_in, split_using, sum, sum_of, union, variance_of, where, with_max_of, with_min_of,
Date-related operators​
-, !=, +, <, <=, =, >, >=, after, before, between, every, milliseconds_between, minus_days, minus_hours, minus_minutes, minus_months, minus_ms, minus_weeks, minus_years, months_between, plus_days, plus_hours, plus_minutes, plus_months, plus_ms, plus_weeks, plus_years, since, to, until, years_between,
Dates​
Displays​
Driving operators​
edge​
EDP-related operators​
Files-related operators​
crs, csv_file, dxf_file, evaluate_sub_model, file_exists, folder, folder_exists, gaml_file, geojson_file, get, gif_file, gml_file, grid_file, image_file, is_csv, is_dxf, is_gaml, is_geojson, is_gif, is_gml, is_grid, is_image, is_json, is_obj, is_osm, is_pgm, is_property, is_R, is_saved_simulation, is_shape, is_svg, is_text, is_threeds, is_xml, json_file, new_folder, obj_file, osm_file, pgm_file, property_file, R_file, read, saved_simulation_file, shape_file, step_sub_model, svg_file, text_file, threeds_file, writable, xml_file,
FIPA-related operators​
GamaMetaType​
Graphs-related operators​
add_edge, add_node, adjacency, agent_from_geometry, all_pairs_shortest_path, alpha_index, as_distance_graph, as_edge_graph, as_intersection_graph, as_path, 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_watts_strogatz, grid_cells_to_graph, in_degree_of, in_edges_of, layout_circle, layout_force, layout_grid, load_graph_from_file, 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_optimizer_type, with_weights,
Grid-related operators​
as_4_grid, as_grid, as_hexagonal_grid, grid_at, path_between,
Iterator operators​
accumulate, all_match, as_map, collect, count, create_map, first_with, frequency_of, group_by, index_by, last_with, max_of, mean_of, min_of, none_matches, one_matches, product_of, sort_by, sum_of, variance_of, where, with_max_of, with_min_of,
List-related operators​
all_indexes_of, copy_between, index_of, last_index_of,
Logical operators​
:, !, ?, add_3Dmodel, add_geometry, add_icon, and, or, xor,
Map comparaison operators​
fuzzy_kappa, fuzzy_kappa_sim, kappa, kappa_sim, percent_absolute_deviation,
Map-related operators​
as_map, create_map, index_of, last_index_of,
Material​
Matrix-related operators​
-, /, ., *, +, append_horizontally, append_vertically, column_at, columns_list, determinant, eigenvalues, index_of, inverse, last_index_of, row_at, rows_list, shuffle, trace, transpose,
multicriteria operators​
electre_DM, evidence_theory_DM, fuzzy_choquet_DM, promethee_DM, weighted_means_DM,
Path-related operators​
agent_from_geometry, all_pairs_shortest_path, as_path, load_shortest_paths, max_flow_between, path_between, path_to, paths_between, use_cache,
Points-related operators​
-, /, *, +, <, <=, >, >=, add_point, angle_between, any_location_in, centroid, closest_points_with, farthest_point_to, grid_at, norm, points_along, points_at, points_on,
Random operators​
binomial, flip, gamma_density, gamma_rnd, gamma_trunc_rnd, gauss, lognormal_density, lognormal_rnd, lognormal_trunc_rnd, open_simplex_generator, poisson, rnd, rnd_choice, sample, shuffle, simplex_generator, skew_gauss, truncated_gauss, weibull_density, weibull_rnd, weibull_trunc_rnd,
ReverseOperators​
restore_simulation, restore_simulation_from_file, save_agent, save_simulation, serialize, serialize_agent,
Shape​
arc, box, circle, cone, cone3D, cross, cube, curve, cylinder, ellipse, elliptical_arc, envelope, geometry_collection, hexagon, line, link, plan, polygon, polyhedron, pyramid, rectangle, sphere, square, squircle, teapot, triangle,
Spatial operators​
-, *, +, add_point, agent_closest_to, agent_farthest_to, agents_at_distance, agents_inside, agents_overlapping, angle_between, any_location_in, arc, around, as_4_grid, as_grid, as_hexagonal_grid, at_distance, at_location, box, centroid, circle, clean, clean_network, closest_points_with, closest_to, cone, cone3D, convex_hull, covers, cross, crosses, crs, CRS_transform, cube, curve, cylinder, dem, direction_between, disjoint_from, distance_between, distance_to, ellipse, elliptical_arc, envelope, farthest_point_to, farthest_to, geometry_collection, gini, hexagon, hierarchical_clustering, IDW, inside, inter, intersects, inverse_rotation, line, link, masked_by, moran, neighbors_at, neighbors_of, normalized_rotation, overlapping, overlaps, partially_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, towards, transformed_by, translated_by, triangle, triangulate, union, using, voronoi, with_precision, without_holes,
Spatial properties operators​
covers, crosses, intersects, partially_overlaps, touches,
Spatial queries operators​
agent_closest_to, agent_farthest_to, agents_at_distance, agents_inside, agents_overlapping, at_distance, closest_to, farthest_to, inside, neighbors_at, neighbors_of, overlapping,
Spatial relations operators​
direction_between, distance_between, distance_to, path_between, path_to, towards,
Spatial statistical operators​
hierarchical_clustering, simple_clustering_by_distance,
Spatial transformations operators​
-, *, +, as_4_grid, as_grid, as_hexagonal_grid, at_location, clean, clean_network, convex_hull, CRS_transform, inverse_rotation, normalized_rotation, rotated_by, rotation_composition, scaled_to, simplification, skeletonize, smooth, split_geometry, split_lines, to_GAMA_CRS, to_rectangles, to_segments, to_squares, to_sub_geometries, transformed_by, translated_by, triangulate, voronoi, with_precision, without_holes,
Species-related operators​
index_of, last_index_of, of_generic_species, of_species,
Statistical operators​
auto_correlation, beta, binomial_coeff, binomial_complemented, binomial_sum, build, chi_square, chi_square_complemented, corR, correlation, covariance, dbscan, distribution_of, distribution2d_of, dtw, durbin_watson, frequency_of, gamma, gamma_distribution, gamma_distribution_complemented, geometric_mean, gini, harmonic_mean, hierarchical_clustering, incomplete_beta, incomplete_gamma, incomplete_gamma_complement, kmeans, kurtosis, kurtosis, log_gamma, max, mean, mean_deviation, meanR, median, min, moment, moran, mul, normal_area, normal_density, normal_inverse, predict, pValue_for_fStat, pValue_for_tStat, quantile, quantile_inverse, rank_interpolated, rms, simple_clustering_by_distance, skew, skewness, split, split_in, split_using, standard_deviation, student_area, student_t_inverse, sum, variance, variance,
Strings-related operators​
+, <, <=, >, >=, at, char, contains, contains_all, contains_any, copy_between, date, empty, first, in, indented_by, index_of, is_number, last, last_index_of, length, lower_case, replace, replace_regex, reverse, sample, shuffle, split_with, string, upper_case,
SubModel​
System​
., choose, command, copy, copy_to_clipboard, dead, enter, eval_gaml, every, is_error, is_warning, user_input,
Time-related operators​
Types-related operators​
action, agent, attributes, BDIPlan, bool, container, emotion, file, float, gaml_type, geometry, graph, int, kml, list, map, material, matrix, mental_state, Norm, pair, path, point, predicate, regression, rgb, Sanction, skill, social_link, topology, unknown,
User control operators​
Operators​
sample
​
Possible use:​
sample
(any expression
) --->string
string
sample
any expression
--->string
sample
(string
,any expression
) --->string
sample
(list
,int
,bool
) --->list
sample
(list
,int
,bool
,list
) --->list
Result:​
takes a sample of the specified size from the elements of x using either with or without replacement takes a sample of the specified size from the elements of x using either with or without replacement with given weights
Examples:​
list var0 <- sample([2,10,1],2,false); // var0 equals [10,1]
list var1 <- sample([2,10,1],2,false,[0.1,0.7,0.2]); // var1 equals [10,2]
Sanction
​
Possible use:​
Sanction
(any
) --->Sanction
Result:​
save_agent
​
Possible use:​
agent
save_agent
string
--->int
save_agent
(agent
,string
) --->int
save_simulation
​
Possible use:​
save_simulation
(string
) --->int
saved_simulation_file
​
Possible use:​
saved_simulation_file
(string
) --->file
string
saved_simulation_file
list<agent>
--->file
saved_simulation_file
(string
,list<agent>
) --->file
string
saved_simulation_file
bool
--->file
saved_simulation_file
(string
,bool
) --->file
Result:​
Constructs a file of type saved_simulation. Allowed extensions are limited to gsim, gasim
Special cases:​
- saved_simulation_file(string): Constructor for saved simulation files: read the metadata and content.
- saved_simulation_file(string,list<agent>): Constructor for saved simulation files from a list of agents: it is used with aim of saving a simulation agent.
- saved_simulation_file(string,bool): Constructor for saved simulation files: read the metadata. If and only if the boolean operand is true, the content of the file is read.
See also:​
scaled_by
​
Same signification as *
scaled_to
​
Possible use:​
geometry
scaled_to
point
--->geometry
scaled_to
(geometry
,point
) --->geometry
Result:​
allows to restrict the size of a geometry so that it fits in the envelope {width, height, depth} defined by the second operand
Examples:​
geometry var0 <- shape scaled_to {10,10}; // var0 equals a geometry corresponding to the geometry of the agent applying the operator scaled so that it fits a square of 10x10
select
​
Same signification as where
serialize
​
Possible use:​
serialize
(unknown
) --->string
Result:​
It serializes any object, i.e. transform it into a string.
serialize_agent
​
Possible use:​
serialize_agent
(agent
) --->string
set_about
​
Possible use:​
emotion
set_about
predicate
--->emotion
set_about
(emotion
,predicate
) --->emotion
Result:​
change the about value of the given emotion
Examples:​
emotion set_about predicate1
set_agent
​
Possible use:​
social_link
set_agent
agent
--->social_link
set_agent
(social_link
,agent
) --->social_link
Result:​
change the agent value of the given social link
Examples:​
social_link set_agent agentA
set_agent_cause
​
Possible use:​
emotion
set_agent_cause
agent
--->emotion
set_agent_cause
(emotion
,agent
) --->emotion
predicate
set_agent_cause
agent
--->predicate
set_agent_cause
(predicate
,agent
) --->predicate
Result:​
change the agentCause value of the given emotion change the agentCause value of the given predicate
Examples:​
emotion set_agent_cause agentA
predicate set_agent_cause agentA
set_decay
​
Possible use:​
emotion
set_decay
float
--->emotion
set_decay
(emotion
,float
) --->emotion
Result:​
change the decay value of the given emotion
Examples:​
emotion set_decay 12
set_dominance
​
Possible use:​
social_link
set_dominance
float
--->social_link
set_dominance
(social_link
,float
) --->social_link
Result:​
change the dominance value of the given social link
Examples:​
social_link set_dominance 0.4
set_familiarity
​
Possible use:​
social_link
set_familiarity
float
--->social_link
set_familiarity
(social_link
,float
) --->social_link
Result:​
change the familiarity value of the given social link
Examples:​
social_link set_familiarity 0.4
set_intensity
​
Possible use:​
emotion
set_intensity
float
--->emotion
set_intensity
(emotion
,float
) --->emotion
Result:​
change the intensity value of the given emotion
Examples:​
emotion set_intensity 12
set_lifetime
​
Possible use:​
mental_state
set_lifetime
int
--->mental_state
set_lifetime
(mental_state
,int
) --->mental_state
Result:​
change the lifetime value of the given mental state
Examples:​
mental state set_lifetime 1
set_liking
​
Possible use:​
social_link
set_liking
float
--->social_link
set_liking
(social_link
,float
) --->social_link
Result:​
change the liking value of the given social link
Examples:​
social_link set_liking 0.4
set_modality
​
Possible use:​
mental_state
set_modality
string
--->mental_state
set_modality
(mental_state
,string
) --->mental_state
Result:​
change the modality value of the given mental state
Examples:​
mental state set_modality belief
set_predicate
​
Possible use:​
mental_state
set_predicate
predicate
--->mental_state
set_predicate
(mental_state
,predicate
) --->mental_state
Result:​
change the predicate value of the given mental state
Examples:​
mental state set_predicate pred1
set_solidarity
​
Possible use:​
social_link
set_solidarity
float
--->social_link
set_solidarity
(social_link
,float
) --->social_link
Result:​
change the solidarity value of the given social link
Examples:​
social_link set_solidarity 0.4
set_strength
​
Possible use:​
mental_state
set_strength
float
--->mental_state
set_strength
(mental_state
,float
) --->mental_state
Result:​
change the strength value of the given mental state
Examples:​
mental state set_strength 1.0
set_trust
​
Possible use:​
social_link
set_trust
float
--->social_link
set_trust
(social_link
,float
) --->social_link
Result:​
change the trust value of the given social link
Examples:​
social_link set_familiarity 0.4
set_truth
​
Possible use:​
predicate
set_truth
bool
--->predicate
set_truth
(predicate
,bool
) --->predicate
Result:​
change the is_true value of the given predicate
Examples:​
predicate set_truth false
set_z
​
Possible use:​
geometry
set_z
container<unknown,float>
--->geometry
set_z
(geometry
,container<unknown,float>
) --->geometry
set_z
(geometry
,int
,float
) --->geometry
Result:​
Sets the z ordinate of the n-th point of a geometry to the value provided by the third argument
Examples:​
triangle(3) set_z [5,10,14]
set_z (triangle(3), 1, 3.0)
shape_file
​
Possible use:​
shape_file
(string
) --->file
string
shape_file
int
--->file
shape_file
(string
,int
) --->file
string
shape_file
string
--->file
shape_file
(string
,string
) --->file
string
shape_file
bool
--->file
shape_file
(string
,bool
) --->file
shape_file
(string
,int
,bool
) --->file
shape_file
(string
,string
,bool
) --->file
Result:​
Constructs a file of type shape. Allowed extensions are limited to shp
Special cases:​
- shape_file(string): This file constructor allows to read a shapefile (.shp) file
file f <- shape_file("file.shp");
- shape_file(string,int): This file constructor allows to read a shapefile (.shp) file and specifying the coordinates system code, as an int (epsg code)
file f <- shape_file("file.shp", "32648");
- shape_file(string,string): This file constructor allows to read a shapefile (.shp) file and specifying the coordinates system code (epg,...,), as a string
file f <- shape_file("file.shp", "EPSG:32648");
- shape_file(string,bool): This file constructor allows to read a shapefile (.shp) file and take a potential z value (not taken in account by default)
file f <- shape_file("file.shp", true);
- shape_file(string,int,bool): This file constructor allows to read a shapefile (.shp) file and specifying the coordinates system code, as an int (epsg code) and take a potential z value (not taken in account by default)
file f <- shape_file("file.shp", "32648", true);
- shape_file(string,string,bool): This file constructor allows to read a shapefile (.shp) file and specifying the coordinates system code (epg,...,), as a string and take a potential z value (not taken in account by default)
file f <- shape_file("file.shp", "EPSG:32648",true);
See also:​
shuffle
​
Possible use:​
shuffle
(matrix
) --->matrix
shuffle
(string
) --->string
shuffle
(container
) --->list
Result:​
The elements of the operand in random order.
Special cases:​
- if the operand is empty, returns an empty list (or string, matrix)
Examples:​
matrix var0 <- shuffle (matrix([["c11","c12","c13"],["c21","c22","c23"]])); // var0 equals matrix([["c12","c21","c11"],["c13","c22","c23"]]) (for example)
string var1 <- shuffle ('abc'); // var1 equals 'bac' (for example)
list var2 <- shuffle ([12, 13, 14]); // var2 equals [14,12,13] (for example)
See also:​
signum
​
Possible use:​
signum
(float
) --->int
Result:​
Returns -1 if the argument is negative, +1 if it is positive, 0 if it is equal to zero or not a number
Examples:​
int var0 <- signum(-12); // var0 equals -1
int var1 <- signum(14); // var1 equals 1
int var2 <- signum(0); // var2 equals 0
simple_clustering_by_distance
​
Possible use:​
container<unknown,agent>
simple_clustering_by_distance
float
--->list<list<agent>>
simple_clustering_by_distance
(container<unknown,agent>
,float
) --->list<list<agent>>
Result:​
A list of agent groups clustered by distance considering a distance min between two groups.
Examples:​
list<list<agent>> var0 <- [ag1, ag2, ag3, ag4, ag5] simpleClusteringByDistance 20.0; // var0 equals for example, can return [[ag1, ag3], [ag2], [ag4, ag5]]
See also:​
simple_clustering_by_envelope_distance
​
Same signification as simple_clustering_by_distance
simplex_generator
​
Possible use:​
simplex_generator
(float
,float
,float
) --->float
Result:​
take a x, y and a bias parameters and gives a value
Examples:​
float var0 <- simplex_generator(2,3,253); // var0 equals 0.0976676931220678
simplification
​
Possible use:​
geometry
simplification
float
--->geometry
simplification
(geometry
,float
) --->geometry
Result:​
A geometry corresponding to the simplification of the operand (geometry, agent, point) considering a tolerance distance.
Comment:​
The algorithm used for the simplification is Douglas-Peucker
Examples:​
geometry var0 <- self simplification 0.1; // var0 equals the geometry resulting from the application of the Douglas-Peuker algorithm on the geometry of the agent applying the operator with a tolerance distance of 0.1.
sin
​
Possible use:​
sin
(int
) --->float
sin
(float
) --->float
Result:​
Returns the value (in [-1,1]) of the sinus of the operand (in decimal degrees). The argument is casted to an int before being evaluated.
Special cases:​
- Operand values out of the range [0-359] are normalized.
Examples:​
float var0 <- sin (0); // var0 equals 0.0
float var1 <- sin(360) with_precision 10 with_precision 10; // var1 equals 0.0
See also:​
sin_rad
​
Possible use:​
sin_rad
(float
) --->float
Result:​
Returns the value (in [-1,1]) of the sinus of the operand (in radians).
Examples:​
float var0 <- sin_rad(0); // var0 equals 0.0
float var1 <- sin_rad(#pi/2); // var1 equals 1.0
See also:​
since
​
Possible use:​
since
(date
) --->bool
any expression
since
date
--->bool
since
(any expression
,date
) --->bool
Result:​
Returns true if the current_date of the model is after (or equal to) the date passed in argument. Synonym of 'current_date >= argument'. Can be used, like 'after', in its composed form with 2 arguments to express the lowest boundary of the computation of a frequency. However, contrary to 'after', there is a subtle difference: the lowest boundary will be tested against the frequency as well
Examples:​
reflex when: since(starting_date) {} // this reflex will always be run
every(2#days) since (starting_date + 1#day) // the computation will return true 1 day after the starting date and every two days after this reference date
skeletonize
​
Possible use:​
skeletonize
(geometry
) --->list<geometry>
geometry
skeletonize
float
--->list<geometry>
skeletonize
(geometry
,float
) --->list<geometry>
skeletonize
(geometry
,float
,float
) --->list<geometry>
skeletonize
(geometry
,float
,float
,bool
) --->list<geometry>
Result:​
A list of geometries (polylines) corresponding to the skeleton of the operand geometry (geometry, agent) with the given tolerance for the clipping and for the triangulation A list of geometries (polylines) corresponding to the skeleton of the operand geometry (geometry, agent) with the given tolerance for the clipping and for the triangulation A list of geometries (polylines) corresponding to the skeleton of the operand geometry (geometry, agent) with the given tolerance for the clipping A list of geometries (polylines) corresponding to the skeleton of the operand geometry (geometry, agent)
Examples:​
list<geometry> var0 <- skeletonize(self); // var0 equals the list of geometries corresponding to the skeleton of the geometry of the agent applying the operator.
list<geometry> var1 <- skeletonize(self); // var1 equals the list of geometries corresponding to the skeleton of the geometry of the agent applying the operator.
list<geometry> var2 <- skeletonize(self); // var2 equals the list of geometries corresponding to the skeleton of the geometry of the agent applying the operator.
list<geometry> var3 <- skeletonize(self); // var3 equals the list of geometries corresponding to the skeleton of the geometry of the agent applying the operator.
skew
​
Possible use:​
skew
(container
) --->float
float
skew
float
--->float
skew
(float
,float
) --->float
Result:​
Returns the skew of a data sequence when the 3rd moment has already been computed. Returns the skew of a data sequence, which is moment(data,3,mean) / standardDeviation3
Comment:​
In R moment(c(1, 3, 5, 6, 9, 11, 12, 13), order=3,center=TRUE) is -10.125 and sd(c(1,3,5,6,9,11,12,13)) = 4.407785The value of the skewness tested here is different because there are different types of estimatorJoanes and Gill (1998) discuss three methods for estimating skewness:Type 1: g_1 = m_3 / m_2^(3/2). This is the typical definition used in many older textbooks.Type 2: G_1 = g_1 * sqrt(n(n-1)) / (n-2). Used in SAS and SPSS.Type 3: b_1 = m_3 / s^3 = g_1 ((n-1)/n)^(3/2). Used in MINITAB and BMDP.In R skewness(c(1, 3, 5, 6, 9, 11, 12, 13),type=3) is -0.1182316
Examples:​
float var0 <- skew(-10.125,4.407785) with_precision(2); // var0 equals -0.12
float var1 <- skew([1,3,5,6,9,11,12,13]) with_precision(2); // var1 equals -0.14
skew_gauss
​
Possible use:​
skew_gauss
(float
,float
,float
,float
) --->float
Result:​
A value from a skew normally distributed random variable with min value (the minimum skewed value possible), max value (the maximum skewed value possible), skew (the degree to which the values cluster around the mode of the distribution; higher values mean tighter clustering) and bias (the tendency of the mode to approach the min, max or midpoint value; positive values bias toward max, negative values toward min).The algorithm was taken from http://stackoverflow.com/questions/5853187/skewing-java-random-number-generation-toward-a-certain-number
Examples:​
float var0 <- skew_gauss(0.0, 1.0, 0.7,0.1); // var0 equals 0.1729218460343077
See also:​
binomial, gamma_rnd, gauss_rnd, lognormal_rnd, poisson, rnd, truncated_gauss, weibull_rnd,
skewness
​
Possible use:​
skewness
(list
) --->float
Result:​
returns skewness value computed from the operand list of values