Expression Quick Reference
Alphabetical index of all named SELES expression functions. Click the section link to jump to the full syntax description in Expression Syntax.
Operators (+, -, *, /, ^, %, |Expr|, EQ, NEQ, <, <=, >, >=, !, AND, OR, and shorthand assignments ++, --, +=, -=, *=) are documented in sections 1.2 and 1.3.
| Function / Expression | Brief description | Section |
|---|---|---|
ABS(Expr) · ABSOLUTE(Expr) | Absolute value | 1.2 |
ADD ROOT(Tree, Item) | Set root node of a tree | 1.20 |
ARCCOS(Expr) | Inverse cosine (degrees) | 1.10 |
ARCSIN(Expr) | Inverse sine (degrees) | 1.10 |
ARCTAN(Expr) · ARCTAN(x, y) | Inverse tangent; two-arg form gives quadrant | 1.10 |
AT LOCATION(Expr) … END | Evaluate sub-expressions at a specific location | 1.6 |
BITWISE AND(a, b) | Bitwise AND | 1.12 |
BITWISE NOT Expr | Bitwise NOT | 1.12 |
BITWISE OR(a, b) | Bitwise OR | 1.12 |
BITWISE XOR(a, b) | Bitwise exclusive-OR | 1.12 |
CEILING(Expr) | Smallest integer ≥ value (round up) | 1.2 |
CHILDREN(Tree, Pos) | Number of children at a tree node | 1.20 |
CLAMP(Expr, Min, Max) | Restrict value to range [Min, Max] | 1.2 |
CLASSIFIED_DIST … END | Draw from a discrete distribution | 1.8 |
CLASSIFY(Variable) … END | Return expression or value at class index | 1.11 |
CONTAINS(Set, Item) | TRUE if set contains item | 1.18 |
CONTAG(Matrix, Matrix) | Temporal contagion matrix | 1.16 |
COS(Expr) | Cosine (angles in degrees, compass) | 1.10 |
DEBUG | Update simulation probe | 1.13 |
DIRECTION(loc1, loc2) | Angle in degrees between two locations | 1.6 |
DISPLAY … END | Print labelled values to screen | 1.7 |
DISTANCE(loc1, loc2) | Euclidean distance between two locations | 1.6 |
EXP(Expr) | Natural exponential (e^Expr) | 1.2 |
FIND(Linked, ItemVar, Condition) | First position matching condition; 0 if none | 1.17 |
FIND NEXT(Linked, Pos, ItemVar, Cond) | Next matching position after Pos; 0 if none | 1.17 |
FIRST(Linked) | Position of first item; 0 if empty | 1.17 |
FLOOR(Expr) | Largest integer ≤ value (round down) | 1.2 |
GET(Linked, Pos) | Item at position (use with [=]) | 1.17 |
GET AT INDEX(List, #Index) | List entry at index (use with [=]) | 1.19 |
GET HEAD(List) | First list entry (use with [=]) | 1.19 |
GET TAIL(List) | Last list entry (use with [=]) | 1.19 |
HEAD(List) | Position of first list entry | 1.19 |
INSERT(Set, Item) | Add element to set (no-op if already present) | 1.18 |
INSERT AT(List, #Index, Item) | Insert list entry at index | 1.19 |
INSERT AFTER(List, #Index, Item) | Insert list entry after index | 1.19 |
INSERT BEFORE(List, #Index, Item) | Insert list entry before index | 1.19 |
INSERT CHILD(Tree, Pos, Item, #Index) | Add child to node at given index | 1.20 |
INSERT HEAD(List, Item) | Add entry to front of list | 1.19 |
INSERT LEFT CHILD(Tree, Pos, Item) | Add leftmost child to node | 1.20 |
INSERT RIGHT CHILD(Tree, Pos, Item) | Add rightmost child to node | 1.20 |
INSERT TAIL(List, Item) | Add entry to end of list | 1.19 |
INTERPOLATE(Variable) … END | Interpolated value between class boundaries | 1.11 |
INTERSECTION(Set1, Set2) | Set intersection | 1.18 |
IS EMPTY(Linked) | TRUE if structure has zero items | 1.17 |
LEFT CHILD(Tree, Pos) | Position of leftmost child of node | 1.20 |
LOG(Expr) | Natural logarithm; log base b = LOG(x)/LOG(b) | 1.2 |
LOG NORMAL(mean, stddev) | Draw from log-normal distribution | 1.8 |
LOG NORMAL CDF(x, mean, stddev) | Log-normal cumulative density | 1.9 |
LOG NORMAL PDF(x, mean, stddev) | Log-normal probability density | 1.9 |
LOG NORMAL TEMPORAL PDF(x, mean, stddev) | Conditional log-normal density (given not yet selected) | 1.9 |
LOOKUP(Variable) … END | Interpolated lookup; classes are real values | 1.11 |
MAX(a, b) | Larger of two values | 1.2 |
MAX POSITION(Expr) | Highest set bit position; −1 if none | 1.12 |
MIN(a, b) | Smaller of two values | 1.2 |
MIN POSITION(Expr) | Lowest set bit position; −1 if none | 1.12 |
MPM_MULT(Matrix, Matrix) | Matrix population model integer multiplication | 1.16 |
NEGEXP(mean) | Draw from negative exponential distribution | 1.8 |
NEXT(Linked, Pos) | Next position; 0 if last | 1.17 |
NORMAL(mean, stddev) | Draw from normal distribution | 1.8 |
NORMAL CDF(x, mean, stddev) | Normal cumulative density | 1.9 |
NORMAL PDF(x, mean, stddev) | Normal probability density | 1.9 |
NORMAL TEMPORAL PDF(x, mean, stddev) | Conditional normal density (given not yet selected) | 1.9 |
OUTPUT(OutputVar) … END | Write labelled values to output file | 1.7 |
OVER INDEX(n1, n2) … END | Procedural for-loop over index range | 1.5 |
OVER RegionFunction … END | Apply sub-expressions to all cells in region | 1.15 |
PARENT(Tree, Pos) | Position of parent node; 0 for root | 1.20 |
PAUSE | Halt simulation until user responds | 1.13 |
PAUSE IF Expr | Conditional pause | 1.13 |
PAUSE(#ms) | Pause for N milliseconds then continue | 1.13 |
POISSION(mean) | Draw from Poisson distribution | 1.8 |
POS AT INDEX(List, #Index) | Position at index; 0 if no entry | 1.19 |
PREV(Linked, Pos) | Previous position; 0 if first | 1.17 |
RECOMPUTE | Re-compute probability surface before next selection | 1.13 |
REGION CENTRED(Expr, Expr, …) | Region centred on current cell (cardinal or Euclidean radius) | 1.15 |
REGION COST SURFACE(…) | Region expanding by cost from source cell | 1.15 |
REGION LEAST COST PATH(…) | Region along least-cost path between two cells | 1.15 |
REGION LOCATION(Expr) | Single-cell region | 1.15 |
REGION LOCATION LIST(…) | Region of specific known locations | 1.15 |
REGION RECT(…) | Rectangular region | 1.15 |
REGION VECTOR(start, end) | Region along approximate line between two cells | 1.15 |
REGION WHOLE MAP | Entire landscape | 1.15 |
REMOVE(Linked, Pos) | Remove and delete item at position | 1.17 |
REMOVE ALL(Linked) | Clear all items | 1.17 |
REMOVE AT INDEX(List, #Index) | Remove list entry at index | 1.19 |
REMOVE HEAD(List) | Remove and delete first list entry | 1.19 |
REMOVE TAIL(List) | Remove and delete last list entry | 1.19 |
ROOT(Tree) | Position of tree root node | 1.20 |
ROUND(Expr) | Round to nearest integer | 1.2 |
SEED() | Return current random number seed | 1.13 |
SEED(Expr) | Set random number seed; return next seed | 1.13 |
SELECTAT(Expr, PositionList) | TRUE if any listed bit is set | 1.12 |
SETAT(Expr, Positions, Type) | Set bits at listed positions | 1.12 |
SET(Linked, Pos, Item) | Set item attributes at position | 1.17 |
SHIFT LEFT(a, n) | Shift bits left by n positions | 1.12 |
SHIFT RIGHT(a, n) | Shift bits right by n positions | 1.12 |
SIN(Expr) | Sine (angles in degrees, compass) | 1.10 |
SIZE(Linked) | Number of items in structure | 1.17 |
SKEWED NORMAL(mode, leftSD, rightSD) | Draw from skewed normal distribution | 1.8 |
SKEWED NORMAL CDF(x, mode, leftSD, rightSD) | Skewed normal cumulative density | 1.9 |
SKEWED NORMAL PDF(x, mode, leftSD, rightSD) | Skewed normal probability density | 1.9 |
SKEWED NORMAL TEMPORAL PDF(…) | Conditional skewed normal density | 1.9 |
SORT(Linked, …) | Sort linked structure items | 1.17 |
SORT(Matrix, Expr) | Sort matrix rows by expression | 1.16 |
SUBTRACT(Set1, Set2) | Remove Set2 elements from Set1 | 1.18 |
SUM(Matrix) | Sum of all array entries (scalar) | 1.16 |
SUM COLS(Matrix) | Sum over columns (one value per row) | 1.16 |
SUM ROWS(Matrix) | Sum over rows (one value per column) | 1.16 |
SWITCH(Variable) … END | Procedural class-based selector | 1.11 |
TAIL(List) | Position of last list entry | 1.19 |
TAN(Expr) | Tangent (angles in degrees, compass) | 1.10 |
TRANSPOSE(Matrix) | Flip rows and columns of matrix | 1.16 |
UNIFORM(min, max) | Draw from uniform distribution | 1.8 |
UNIFORM TEMPORAL PDF(x, min, max) | Conditional uniform density (given not yet selected) | 1.9 |
UNION(Set1, Set2) | Set union | 1.18 |
WEIBULL(beta, alpha) | Draw from Weibull distribution | 1.8 |
WHILE Expr … END | Procedural while-loop | 1.4 |