Skip to main content

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 / ExpressionBrief descriptionSection
ABS(Expr) · ABSOLUTE(Expr)Absolute value1.2
ADD ROOT(Tree, Item)Set root node of a tree1.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 quadrant1.10
AT LOCATION(Expr) … ENDEvaluate sub-expressions at a specific location1.6
BITWISE AND(a, b)Bitwise AND1.12
BITWISE NOT ExprBitwise NOT1.12
BITWISE OR(a, b)Bitwise OR1.12
BITWISE XOR(a, b)Bitwise exclusive-OR1.12
CEILING(Expr)Smallest integer ≥ value (round up)1.2
CHILDREN(Tree, Pos)Number of children at a tree node1.20
CLAMP(Expr, Min, Max)Restrict value to range [Min, Max]1.2
CLASSIFIED_DIST … ENDDraw from a discrete distribution1.8
CLASSIFY(Variable) … ENDReturn expression or value at class index1.11
CONTAINS(Set, Item)TRUE if set contains item1.18
CONTAG(Matrix, Matrix)Temporal contagion matrix1.16
COS(Expr)Cosine (angles in degrees, compass)1.10
DEBUGUpdate simulation probe1.13
DIRECTION(loc1, loc2)Angle in degrees between two locations1.6
DISPLAY … ENDPrint labelled values to screen1.7
DISTANCE(loc1, loc2)Euclidean distance between two locations1.6
EXP(Expr)Natural exponential (e^Expr)1.2
FIND(Linked, ItemVar, Condition)First position matching condition; 0 if none1.17
FIND NEXT(Linked, Pos, ItemVar, Cond)Next matching position after Pos; 0 if none1.17
FIRST(Linked)Position of first item; 0 if empty1.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 entry1.19
INSERT(Set, Item)Add element to set (no-op if already present)1.18
INSERT AT(List, #Index, Item)Insert list entry at index1.19
INSERT AFTER(List, #Index, Item)Insert list entry after index1.19
INSERT BEFORE(List, #Index, Item)Insert list entry before index1.19
INSERT CHILD(Tree, Pos, Item, #Index)Add child to node at given index1.20
INSERT HEAD(List, Item)Add entry to front of list1.19
INSERT LEFT CHILD(Tree, Pos, Item)Add leftmost child to node1.20
INSERT RIGHT CHILD(Tree, Pos, Item)Add rightmost child to node1.20
INSERT TAIL(List, Item)Add entry to end of list1.19
INTERPOLATE(Variable) … ENDInterpolated value between class boundaries1.11
INTERSECTION(Set1, Set2)Set intersection1.18
IS EMPTY(Linked)TRUE if structure has zero items1.17
LEFT CHILD(Tree, Pos)Position of leftmost child of node1.20
LOG(Expr)Natural logarithm; log base b = LOG(x)/LOG(b)1.2
LOG NORMAL(mean, stddev)Draw from log-normal distribution1.8
LOG NORMAL CDF(x, mean, stddev)Log-normal cumulative density1.9
LOG NORMAL PDF(x, mean, stddev)Log-normal probability density1.9
LOG NORMAL TEMPORAL PDF(x, mean, stddev)Conditional log-normal density (given not yet selected)1.9
LOOKUP(Variable) … ENDInterpolated lookup; classes are real values1.11
MAX(a, b)Larger of two values1.2
MAX POSITION(Expr)Highest set bit position; −1 if none1.12
MIN(a, b)Smaller of two values1.2
MIN POSITION(Expr)Lowest set bit position; −1 if none1.12
MPM_MULT(Matrix, Matrix)Matrix population model integer multiplication1.16
NEGEXP(mean)Draw from negative exponential distribution1.8
NEXT(Linked, Pos)Next position; 0 if last1.17
NORMAL(mean, stddev)Draw from normal distribution1.8
NORMAL CDF(x, mean, stddev)Normal cumulative density1.9
NORMAL PDF(x, mean, stddev)Normal probability density1.9
NORMAL TEMPORAL PDF(x, mean, stddev)Conditional normal density (given not yet selected)1.9
OUTPUT(OutputVar) … ENDWrite labelled values to output file1.7
OVER INDEX(n1, n2) … ENDProcedural for-loop over index range1.5
OVER RegionFunction … ENDApply sub-expressions to all cells in region1.15
PARENT(Tree, Pos)Position of parent node; 0 for root1.20
PAUSEHalt simulation until user responds1.13
PAUSE IF ExprConditional pause1.13
PAUSE(#ms)Pause for N milliseconds then continue1.13
POISSION(mean)Draw from Poisson distribution1.8
POS AT INDEX(List, #Index)Position at index; 0 if no entry1.19
PREV(Linked, Pos)Previous position; 0 if first1.17
RECOMPUTERe-compute probability surface before next selection1.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 cell1.15
REGION LEAST COST PATH(…)Region along least-cost path between two cells1.15
REGION LOCATION(Expr)Single-cell region1.15
REGION LOCATION LIST(…)Region of specific known locations1.15
REGION RECT(…)Rectangular region1.15
REGION VECTOR(start, end)Region along approximate line between two cells1.15
REGION WHOLE MAPEntire landscape1.15
REMOVE(Linked, Pos)Remove and delete item at position1.17
REMOVE ALL(Linked)Clear all items1.17
REMOVE AT INDEX(List, #Index)Remove list entry at index1.19
REMOVE HEAD(List)Remove and delete first list entry1.19
REMOVE TAIL(List)Remove and delete last list entry1.19
ROOT(Tree)Position of tree root node1.20
ROUND(Expr)Round to nearest integer1.2
SEED()Return current random number seed1.13
SEED(Expr)Set random number seed; return next seed1.13
SELECTAT(Expr, PositionList)TRUE if any listed bit is set1.12
SETAT(Expr, Positions, Type)Set bits at listed positions1.12
SET(Linked, Pos, Item)Set item attributes at position1.17
SHIFT LEFT(a, n)Shift bits left by n positions1.12
SHIFT RIGHT(a, n)Shift bits right by n positions1.12
SIN(Expr)Sine (angles in degrees, compass)1.10
SIZE(Linked)Number of items in structure1.17
SKEWED NORMAL(mode, leftSD, rightSD)Draw from skewed normal distribution1.8
SKEWED NORMAL CDF(x, mode, leftSD, rightSD)Skewed normal cumulative density1.9
SKEWED NORMAL PDF(x, mode, leftSD, rightSD)Skewed normal probability density1.9
SKEWED NORMAL TEMPORAL PDF(…)Conditional skewed normal density1.9
SORT(Linked, …)Sort linked structure items1.17
SORT(Matrix, Expr)Sort matrix rows by expression1.16
SUBTRACT(Set1, Set2)Remove Set2 elements from Set11.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) … ENDProcedural class-based selector1.11
TAIL(List)Position of last list entry1.19
TAN(Expr)Tangent (angles in degrees, compass)1.10
TRANSPOSE(Matrix)Flip rows and columns of matrix1.16
UNIFORM(min, max)Draw from uniform distribution1.8
UNIFORM TEMPORAL PDF(x, min, max)Conditional uniform density (given not yet selected)1.9
UNION(Set1, Set2)Set union1.18
WEIBULL(beta, alpha)Draw from Weibull distribution1.8
WHILE Expr … ENDProcedural while-loop1.4