FailureModel

class FailureModel(val basis: FailureBasis, val betweenFailures: RVariableIfc, val repairTime: RVariableIfc)(source)

When a vehicle fails, and how long it takes to put right.

A failure is due once the chosen basis quantity has advanced by a draw from betweenFailures since the last repair. Both clock-based and usage-based failures are that one statement with a different basis, which is why there is one class here and not three.

A failure is noticed at the vehicle's next check point, not at the instant it becomes due. The basis quantities advance continuously and none of them has events of its own, so a failure accrues silently and fires either at the next zone boundary or at the end of the current tour, whichever the vehicle reaches first. That is the same rule the battery uses for exhaustion, and for the same reason: a zone boundary is the only place a vehicle can be stopped without leaving a claimed zone with no arrival.

A vehicle parked with nothing to do therefore does not fail while parked. It fails at the first boundary of its next journey, carrying whatever failures came due while it stood there. For a fleet that is busy this is a rounding difference; for one that is idle most of the time it is not, and CALENDAR_TIME on such a fleet should be read as "failures that had become due by the time the vehicle next worked".

A failure does not revoke the vehicle's assignment. The vehicle keeps its load, is repaired where it stands, and resumes the tour it was running from the stop it had reached. Anything else would mean a broken-down vehicle put its load back on the board while still holding it.

Parameters

basis

what the threshold is measured against

betweenFailures

how much of the basis quantity passes between failures, in that basis's own units -- time for the two clock bases, length for distance, a count for tasks

repairTime

how long a repair takes, in model time units

Constructors

Link copied to clipboard
constructor(basis: FailureBasis, betweenFailures: RVariableIfc, repairTime: RVariableIfc)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun toString(): String