Alphabetical list of most commonly used functions, Trigonometric functions are listed separately. Please see the other categories at the bottom of the page for less common or recently added functions.
Template | Effect |
Input(s) |
Return value |
Returns the absolute value of X |
|||
all{X}) |
Result is true if all the elements of the array [X] or the list {X} are true |
boolean array/list |
Boolean |
any({X}) |
Result is true if any of the elements of the array [X] or the list {X} are true. |
boolean array or list |
Boolean |
at_init(X) | Returns X's value when last initialized or reset | Any | Same as input |
Causes component to get value from instance of C in a grid submodel | Any, two optional integers | Scalar as 1st argument | |
binome(P, N) | Returns a value from the binomial distribution with probability P and number of trials N |
Real value from 0 to 1, Integer value |
Integer value |
Rounds up X to the next whole number |
|||
X is an immigration, reproduction or creation channel. Returns true if this individual appeared through that channel. |
|||
colin([X]) | Returns an index to the given array, with probabilities proportional to the array's values | Array of numeric values | Integer or enumerated type member |
const_delay(X, T) | Returns the value of X as it was T time units earlier in the run, or 0 or "false" if the component did not exist at that time | Any non-array type, numeric constant | As 1st argument |
Number of values in the array [X] or the list {X} |
scalar array/list |
||
Insert a material delay of order 1, 3 or n |
numerical |
numerical, numerical, integer (delayn only) | |
dies_of(X) | X is a loss channel. True if channel specifies the removal of the individual this time step. | from loss channel | Boolean |
Returns the duration of the time step level I |
|||
Picks the I'th value form the array [X] |
array of any type,integer or enumerated type member |
||
Returns e to the power X |
|||
Samples an exponential distribution |
numerical[, integer] | numerical | |
first(T) | Returns "true" if argument is the first member of its enumerated type | Enumerated type member | Boolean |
firsttrue([B]) | Takes an array of booleans and returns the index of the first with value "true" | Array of booleans | Integer or enumerated type member |
Rounds X down to a whole number |
|||
Returns remainder after dividing X by Y |
numeric, numeric |
||
following(T) | Returns next member of argument's enumerated type | Enumerated type member | Enumerated type member |
forcst(input, time, horizon [, initial]) | New in v6.6: Performs simple trend extrapolation | Real, real, real [,real] | Real |
gaussian_var(X,Y) | Returns a sample from a Gauusian distribution with mean X and SD Y | Real, real | real |
greatest({X}) |
Returns the largest value from an array [X] or the list {X} |
numeric array/list |
|
howmanytrue([B]) | Takes an array of booleans and returns the number that are true | List or array of booleans | Integer |
hypergeom(P, M, S) | Returns a deviate from a hypergeometric distribution for population, P, number of marks M, and sample size S. | integer, integer, integer | integer |
Returns length of hypotenuse of triangle with base X and height Y |
numeric, numeric |
||
Returns the index (instance number) of a member of a fixed membership or population submodel, for the level I of submodel nesting. |
Integer | Integer or enumerated type member | |
New in v6.6: Returns the value of positive infinity. |
Real | None | |
Returns the time at which this instance appeared -- argument is dummy |
|||
in_preceding(X) | New in Simile v5.7: Returns value of X in preceding submodel instance | Any scalar or array type | As argument |
in_progenitor(X) | New in Simile v5.8: Returns value of X in submodel instance that reproduced to make current one | Any scalar or array type | As argument |
Returns integer part of X |
|||
interpolate(X, [Xarray], [Yarray]) | Returns interpolated value from [Yarray] corresponding to X's place in Xarray |
Numeric, Array of numeric, Array of numeric |
Numeric |
iterations(B) | Counts executions of iterative submodel | Boolean | Integer |
Recalls value of X from previous time step |
|||
least({X}) |
Returns the smallest value from an array [X] or the list {X} |
numeric array/list |
|
Returns natural logarithm of X |
|||
Returns base-10 logarithm of X |
|||
Makes an array consisting of N lots of X |
any type, integer |
array of same type |
|
Returns greater of X and Y |
numeric, numeric |
||
Returns lesser of X and Y |
numeric, numeric |
||
order([X]) | Returns an array holding the indices of the argument array in ascending order of their values | array of numeric | array of integer |
Returns the id of the individual whose reproduction gave rise to this one, or 0 if it immigrated or was created |
|||
When making an array with makearray, this gives each term's position in the array -- argument is nesting depth |
|||
poidev(X) | Returns a value from the Poisson distribution with the given mean | numeric | integer |
posgreatest([X]) | Returns the index of the highest value in the argument array | Array of numeric values | Integer or enumerated type member |
posleast([X]) | Returns the index of the lowest value in the argument array | Array of numeric values | Integer or enumerated type member |
Returns X raised to the power Y |
numeric, numeric |
numeric | |
preceding(T) | Returns previous member of argument's enumerated type | Enumerated type member | Enumerated type member |
Returns the value of this component N time steps ago |
|||
product({X}) |
Result is the product of all elements of the array [X] or the list {X} |
numeric array/list |
numeric |
Generates a single time step pulse of magnitude M at time T, and before or after at intervals of I if I present |
numeric, numeric, numeric |
numeric | |
Generate a linearly increasing or decreasing value over time with the given slope |
numeric, numeric |
numeric | |
(Deprecated) Returns a random number between X and Y, which stays the same until the simulation is reset. |
numeric, numeric |
||
Returns a random number between X and Y, with a new value every time step. |
numeric, numeric |
||
rankings([X]) | Returns ranking of each element in order of size | Array of numerics | Array of integers |
Rounds X up or down to the nearest whole number |
|||
sgn(X) | Returns the size of X; -1 if negative, 1 otherwise | ||
Takes the name of a fixed-membership submodel and returns the number of instances that it has. |
|||
Takes the name of a fixed-membership submodel and returns the size of one of its dimensions |
submodel, numeric |
||
Insert a material smoothing of order 1, 3 or n |
numerical |
numerical, numerical, integer (smthn only) | |
Returns the square root of X |
|||
Generate a step increase (or decrease) at the given time |
numeric, numeric | numeric | |
Stops the simulation, displaying value of X in a popup message |
|||
subtotals([X]) |
Returns running totals from summing the elements in the supplied array |
Numeric array | Numeric array |
Result is the sum of all elements of the argument |
numeric array/list |
||
Returns the current simulation time (the argument is ignored) |
|||
trigger_magnitude() | Returns value of triggering event | As triggering event | |
var_delay(X,T) | Returns value of X as it was T time units earlier in run, or 0 or "false" if this is before component existed | Any non-array type, numeric expression | As first argument |
Returns a value from the list {X} with probabilities proportional to the corresponding values in the list {N} |
numeric list, any list |
member of second arg | |
Returns the value from an array [X] or the list {X} whose position in the array or list corresponds to the largest value in the array [N] or list {N} |
numeric array/list, any array/list |
|
|
Returns the value from an array [X] or the list {X} whose position in the array or list corresponds to the smallest value in the array [N] or list {N} |
numeric array/list, any array/list |
|
In addition, a full range of trigonometric functions are provided.
In: Contents >> Working with equations >> Functions
Comments
Please note that these are
Please note that these are NOT all the built-in functions in Simile. Do not forget to check the links below for other functions available. Also helps to do a global search for a function that you are looking for. You might be lucky to guess how it's called.
Alphabetical list of all functions being made.
Thanks for drawing our attention to the fact that the alphabetical list is incomplete. Work is starting to bring the list up to date.