failures

fun failures(timeBetween: RVariableIfc, repairTime: RVariableIfc, basis: ResourceFailureBasis = ResourceFailureBasis.CALENDAR_TIME, rule: InterruptRule = interruptRule)(source)

Declares that this resource fails and is repaired on its own, in every replication: it waits out timeBetween on basis, fails under rule, stays failed for repairTime, and is repaired, over and over. A failure that comes due while the resource is already failed by a call of fail waits for that repair, and its time between failures starts again from there. A call of repair during the repair time ends that failure early, and the time to the next failure counts from that repair. The declared failures repair only a failure they started: if the model fails the resource again during what was the repair time, that failure lasts until the model repairs it. The waiting is done by an entity of the resource's own, separate from a behavior it may have.

On BUSY_TIME, the time counts while at least one unit is working, whatever the shift or a failure made by fail: a unit finishing its work off shift, under a capacity schedule's zero-capacity item, or through a FINISH failure is working; a unit a RESUME or RESTART failure takes from its holder is not. The time between failures starts at each repair, so a declared failure's own repair time is not counted. A failure comes due at the exact instant that much busy time has passed. On USES, timeBetween is rounded to a whole number of releases (at least 1), and the resource fails at the release that completes it, before the released units are offered to anyone waiting. On every basis the resource fails at the instant the failure comes due, so nothing is allocated in between.

The two times become random variables of this resource, named <name>:TimeBetweenFailuresRV and <name>:RepairTimeRV, so their streams are reset and advanced with the model's other random variables, and an experiment can change their parameters by those names.

It also collects the failure statistics, as collectFailureStatistics does. Declared once, while the model is not running.

Parameters

timeBetween

the time, or the number of uses, between failures

repairTime

the time each failure lasts

basis

what timeBetween counts

rule

what happens to work in service at each failure; by default the resource's interruptRule