Skip to content

Expressions with Parameters ​

A parameter does not have to be a static number: its value can be calculated dynamically through an arithmetic expression referencing other parameters.

BASE = 2
DOUBLE_VAL = BASE * 2      → Evaluates to 4

Whenever BASE changes (manually or during a scenario sweep), DOUBLE_VAL recalculates automatically.


1. Preserving Proportional Relationships ​

When stages in a workflow follow fixed proportions, derived parameters prevent synchronization drift:

TOTAL_CYCLE_TIME = 10
SETUP_TIME       = TOTAL_CYCLE_TIME * 0.3
EXECUTION_TIME   = TOTAL_CYCLE_TIME * 0.7

Sweeping TOTAL_CYCLE_TIME in a study automatically adjusts both sub-stages proportionally without manual intervention.

2. Centralized Unit Conversions ​

If hardware documentation or field telemetry uses a different time unit, convert it in a parameter:

TIME_IN_MINUTES = 45
TIME_IN_SECONDS = TIME_IN_MINUTES * 60

This guarantees all transitions receive inputs aligned with the model's global unit without mental math.

3. Clear Design Rationale ​

TOTAL_CAPACITY        = 100
SAFETY_MARGIN         = TOTAL_CAPACITY * 0.15
OPERATIONAL_CAPACITY  = TOTAL_CAPACITY - SAFETY_MARGIN

Anyone inspecting the model understands the sizing policy immediately. Hardcoding 85 obscures the intent.


Supported Operators ​

Parameter expressions support standard arithmetic operations and parentheses:

OperatorOperationExample
+AdditionA + B
-Subtraction and negationA - B, -A
*MultiplicationA * 1.5
/Division(A + B) / 2
( )Grouping parenthesesA * (B + C)

Standard operator precedence applies: multiplication and division are computed before addition and subtraction.


What is NOT Permitted ​

Parameters cannot access place markings

A parameter expression must never reference place tokens like #Queue or #Place.

Parameters are evaluated once before simulation begins. Place markings change dynamically at every simulated event.

If you need a value that depends on real-time token counts, define a metric, not a parameter.


Cyclic Dependencies ​

Parameters cannot depend on each other in closed loops:

PARAM_A = PARAM_B * 2
PARAM_B = PARAM_A - 5       ← Invalid cyclic dependency

Attempting to run a model with cyclic dependencies causes the validator to abort:

INVALID_DEFINITIONS: definitions contain cyclic dependencies

Resolution ​

Identify the base independent parameter and express all others as one-way functions derived from it.

Best Practices ​

  • Keep expressions concise: Derived parameters should improve readability. Overly long dependency chains (where A feeds B, B feeds C, and C feeds D) make it hard to anticipate the impact of changes.
  • Guard against division by zero: Verify that no divisor parameter can ever evaluate to 0.

Next steps ​

Learn how to define simulation queries in 4 · Metrics.