failures¶
Resource failures: uptime/downtime distribution pairs per named resource group.
In the model file this key holds a list of failure entries, each named by its name.
A scenario, an experiment or an optimizer can set a field by the path failures.<name>.<field>. A data binding can write a field.
Typical uses¶
These sections define what entities wait for and when it is available. resources are the machines, staff and spaces that SEIZE and PROCESS blocks request. resource_sets group resources so that a request takes any one of them. schedules give a resource a shift pattern or give a CREATE block a changing arrival rate. failures break resources down and repair them.
Behaviour and rules¶
A resource has a capacity of units, a queue discipline and optional costs. The discipline is FIFO by default. The ranked disciplines LowestValueFirst and HighestValueFirst need a ranking_expr. With rerank on, the rank is re-evaluated before every grant.
A resource set is seized by its own name. The rule picks one member for each request. PreferredOrder tries the members in the listed order, and Cyclical takes turns. The member that was chosen is the one that is released later.
A schedule is a list of [duration, value] points. The value holds for the duration. With repeat, the pattern starts over, and without it the last value holds for ever. For a capacity schedule the value is a number of units. For an arrival schedule it is a rate per time unit. A weekly grid needs simulation.calendar.
A schedule or a failure never interrupts a job in service. The unit goes out of service when the job frees it. A resource is built at its full capacity, which must cover the highest value its schedule asks for. Each failure draws its own uptime and downtime for each resource it lists.
Fields¶
| Field | Type | Required | Default | Unit | Description |
|---|---|---|---|---|---|
name |
string | yes | The failure's name, shown in the resource log. | ||
resources |
list of string | yes | The resources that fail; each one fails and recovers on its own, drawing its own times. | ||
uptime |
duration | yes | time (uptime.time_unit) |
A duration spec: a distribution, its parameters and an optional unit. Used by link delays and failure uptime/downtime. | |
downtime |
duration | yes | time (downtime.time_unit) |
A duration spec: a distribution, its parameters and an optional unit. Used by link delays and failure uptime/downtime. |
A field of a nested object is described in the JSON Schema (naga schema).
Example¶
The fragment refers to entries that are defined elsewhere in the same file:
{"resources": [{"name": "Server", "capacity": 1}]}
The fragment:
{"failures": [{"name": "Breakdowns", "resources": ["Server"], "uptime": {"distribution": "Exponential", "dist_params": {"rate": 0.01}}, "downtime": {"distribution": "Exponential", "dist_params": {"rate": 0.2}}}]}
In the Python builder:
from nagasim import build as nb
m = nb.Model()
m.add_failure(name='Breakdowns', resources=['Server'], uptime={'distribution': 'Exponential', 'dist_params': {'rate': 0.01}}, downtime={'distribution': 'Exponential', 'dist_params': {'rate': 0.2}})
Used in¶
Bundled models: Biogas digester, holder and CHP, Biogas plant (library assets), Line with finite buffers, Machine with breakdowns, Job shop with MES digital twin, Make-to-order line (library assets).
Guides: Model file format, Coming from AnyLogic, Coming from Arena, Coming from SimPy, How do I model a machine that wears out?, Semantic diff.