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:
- System Values: the simulation clock, work in process, and random numbers.
- Activity Queries: how full an activity is: contents, capacity, queue length.
- Resource Queries: a resource’s free units, utilization, and shift state.
- Entity Properties: a value carried by the current entity: age, cost, type, time in system.
- Gate, Signal, and Inventory Queries: whether a gate is open, a signal is on, or how much stock is on hand.
- Math Functions: rounding, powers, minimum and maximum, and the rest.
- String Functions: joining and trimming text.
Calling a function
Section titled “Calling a function”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 functions that live here
Section titled “Two functions that live here”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 trueppercent 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.

