DELAY¶
Pure waiting time (transit, curing, travel, a pause) that holds the entity for a sampled duration without using any machine, operator or other resource.
Seizes nothing, then forwards it. Use PROCESS instead when the delay is a resource-backed service.
Family: work. Python builder: m.delay(...).
Typical uses¶
Use DELAY for waiting that needs no machine, operator or other resource: transit, curing, cooling, a customer reading a menu. Any number of entities can wait at the same time. When the wait is a service that uses a resource, or when the resource's queue matters, use PROCESS. For a belt with a capacity, use CONVEYOR.
Behaviour and rules¶
The entity waits for one sample of the distribution and then moves on. The block has no capacity limit and no queue, so it never holds an entity longer than its sampled time. The distribution may be an expression that reads the entity's attributes.
A sampled duration below 0 is cut to 0, and a warning is logged on the first one. A distribution that can go negative, such as Normal, raises the warning W_UNBOUNDED_DURATION in a check. A time unit set on the block converts the sample to the model's unit.
In a deterministic run, the wait is the distribution's mean instead of a draw. The block adds no frame of its own. The waiting entities count as work in progress in the system results.
Ports¶
- Inputs: any number of incoming links.
- Outputs: one outgoing link.
Parameters¶
| Parameter | Type | Default | Required | Quantity | Unit key | Description |
|---|---|---|---|---|---|---|
distribution |
str | 'Constant' |
Name of a registered distribution (see the distribution reference). | |||
dist_params |
dict | {'value': 0.0} |
time | time_unit |
Parameters for distribution, by name (e.g. {"rate": 0.5} for Exponential). |
|
time_unit |
str | 'base' |
Unit the sampled duration is expressed in: "base" (the model's own unit, no conversion) or one of seconds/minutes/hours/days. |
Statistics¶
Every run fills system and entity_summary (see the KPI reference). The example below also fills:
| Frame | Columns |
|---|---|
material_flow_summary |
Run, From, To, Entities |
Problem codes¶
A check of the model reports these about this block:
| Code | Meaning |
|---|---|
E_DELAY_UNKNOWN |
A literal DELAY("name") call names no declared delay. |
E_SD_FUNCTION_CONTEXT |
An inline SMOOTH/DELAY call sits where no delay can be generated (a block, a price); only a flow rate, an auxiliary or a delay input may hold one. |
W_SDIMPORT_APPROX |
sdimport/mdlimport translated a construct with a documented approximation (a bare DELAY, a non-euler/rk4 method, a non-day/hour/minute/second time unit, a clock not starting at 0, a graphical function/lookup with no input equation). |
Example¶
The snippet seeds itself; its output is from a run made when this page was generated.
from nagasim import build as nb
m = nb.Model(time_limit=200)
m.create(distribution=nb.Exponential(rate=0.2)) >> m.delay(distribution=nb.Triangular(low=4, mode=5, high=9)) >> m.dispose()
results = m.run(seed=1)
print(round(results.kpi("entity/DEFAULT/Avg Time"), 2), "mean time in the model (a triangular delay, mean 6)")
5.98 mean time in the model (a triangular delay, mean 6)
Used in¶
Bundled models: Berth: shore power, Biogas plant (library assets), Emergency department: staffing game, Warehouse with forklifts (floor plan), Order-driven warehouse (library assets), Priority jobs with rework and 6 more.
Guides: Coming from Vensim, Event log to model, How do I total a subscripted value and remember a past one?, System dynamics, Coming from AnyLogic, Coming from Arena and 10 more.
See also¶
- All blocks, KPI reference, Model file keys, Model file format
- Same family (work): CHARGE, MOTION, PROCESS