Skip to content

Functions

A function works out a value while your model runs. You call one by name inside any expression or action-logic statement, and it hands back a number or a piece of text: the current clock time, how many entities are in an activity, the free units of a resource, an entity’s cost so far.

Functions are grouped by what they read:

Type the function wherever a value is allowed. Object queries name the object in quotes, for example Resource('Doctor').FreeUnits or Activity('Inspect').Contents. As you type in the editor, ProcessModel suggests the function, shows what it returns, and lists its parameters, so you rarely have to remember the exact form.

Two small functions do not fit a family and are documented on this page:

  • IF(condition, valueIfTrue, valueIfFalse) returns one of two values depending on a test. Use it where a single value is needed, such as a route field: IF(a_Priority = 1, 2, 10).
  • PERCENT(p) is true p percent of the time, for a quick random split: IF(PERCENT(30), 1, 0).
LegacyHow this worked in the previous version

Functions provide you with critical system information at any given time during the simulation. They can be used in an assignment statement to set the value of a variable or attribute or in an IF…THEN statement to make a decision based on system information. There are several system functions:

System reserved words cannot be used as variable names, attributes, or scenario parameters.