Simulation and Run Functions
Simulation values
| Name | Value |
|---|---|
TIME | Current simulation time. |
DT | Model timestep. |
STARTTIME | Model start time. Alias: INITIALTIME. |
STOPTIME | Model end time. Alias: ENDTIME. |
RUNCOUNT | Current run number; the native single-run engine initializes it to 1. |
SENSIRUNCOUNT | Current sensitivity run number; initialized to 1. |
SENSIRUNTOTAL | Total sensitivity runs; initialized to 1. |
Time-pattern functions
EVENTFLOW("event", quantity)
Defines the authoritative equation of an Arrival, Service, Route, Transfer, or Departure Flow. The named event supplies exact activation times, payload, and priority; quantity is evaluated once per activation and transferred through the Flow's connected Stock endpoints. Unlike an ordinary SD rate, it is not integrated once per DT. In plots and tables the Flow is 0 at ordinary sample timestamps and reports the actual transferred quantity at an activation timestamp. Capacity, queue, or other constraints should be expressed through ordinary referenced model variables so the authoritative behavior remains visible on the canvas.
Example: EVENTFLOW("Customer Arrival", 1)
Example: EVENTFLOW("Service Completion", MIN(Customers Waiting, Server))
RESOURCECAPACITY("resource")
Returns the current capacity of a named DES resource. When the resource is assigned to a Resource Pool Stock, this is the Stock's current nonnegative whole-unit value—not a separate Architecture constant. Prefer referencing the Stock directly in ordinary calculating variables so the dependency remains visible through a canvas Connector; this function remains useful in generic resource-oriented expressions and for compatibility.
STEP(height, start_time)
Returns 0 before start_time and height at and after it.
Example: STEP(100, 12)
PULSE(start_time, [width])
Returns 1 during the pulse and 0 otherwise. Omitted or zero width uses one DT. Pulse inclusion is evaluated at the midpoint of each timestep.
Example: PULSE(10, 2)
PULSETRAIN(start, width, repeat, end)
Repeats unit pulses from start until end. Alias: PULSE_TRAIN.
Zero width uses one DT. If end <= start, the result is always 0. If repeat <= 0, only the first pulse is used. If repeat < width, the active interval is continuously 1.
Example: PULSETRAIN(2, 1, 5, 20)
RAMP(slope, start, [end])
Returns 0 through start, then increases by slope per time unit. With end, it stops increasing at slope * MAX(end - start, 0).
Example: RAMP(5, 10, 20)
TIMETOTARGET(Stock, Target, Rate, [DT])
Returns the time required for Rate to move a scalar Stock from the Stock's fixed initial equation value to the Target's value at the current simulation time. A dynamic Target is reevaluated at every timestep; its instantaneous value is held fixed while that timestep's required-time integral is calculated. The Stock's evolving simulation value does not change the integration start. With no fourth argument, the function returns the continuously integrated, high-precision time. When a positive DT is supplied, the result is rounded up to the first DT boundary on which a timestep simulation can observe the target. Use the built-in DT value to follow the model's timestep setting.
Before a run starts, Yano verifies that the first argument is a scalar Stock with a fixed initial value and that Rate depends only on that Stock, fixed parameters, and Graphical Functions. When Rate is a connected Flow, its inflow or outflow direction is inferred from the canvas connection. The result is NAN when the Rate cannot reach the current Target.
Example: TIMETOTARGET(Battery Level, Desired Level, Charging Power)
Timestep-aligned example: TIMETOTARGET(Battery Level, Desired Level, Charging Power, DT)
History
HISTORY(variable_or_expression, time, [run])
Evaluates the expression using values at time. run may be a saved-run name string.
Example: HISTORY(Sales, TIME - 1) Example: HISTORY(Sales, 10, "Baseline")
For the current run, a future time returns 0. Missing history also returns 0. HISTORY is non-instantaneous for cycle detection.
Run statistics
Signatures:
RUNCUM(variable, [fromtime, totime, run])RUNSUM(variable, [fromtime, totime, run])RUNMAX(variable, [fromtime, totime, run])RUNMEAN(variable, [fromtime, totime, run])RUNMIN(variable, [fromtime, totime, run])
variable must be a direct model variable reference. run may be a saved-run name. A run string may also appear immediately after the variable when no time bounds are supplied. Optional inputs are trailing: omit them by ending the call after the final supplied value. To skip an earlier optional input while supplying a later one, use NAN as its explicit default placeholder, such as RUNMEAN(variable, NAN, 2025, "Baseline").
RUNCUMtrapezoidally integrates sampled values over time.RUNSUMsums sampled values.RUNMAXandRUNMINreturn sampled extrema.RUNMEANreturns the arithmetic mean of sampled values.
Bounds are clipped to available samples. Invalid ranges, unavailable saved runs, or a requested future endpoint for the current run return NaN; downstream simulation output may sanitize that value.
Example: RUNMEAN(Sales, STARTTIME, TIME) Example: RUNMAX(Inventory, "Baseline")
Yano Simulator Help — Version 0.3.0, Build 20260929