Interruption

sealed class Interruption(val vehicle: FleetVehicle, val at: Double, val location: String, val heldZones: List<Zone>, val wasDoing: TransporterState, val task: Dispatcher.Task?, val loadIsAboard: Boolean)(source)

A vehicle has stopped and cannot carry on by itself.

Sealed, because what a modeller may need to know differs by cause while everything they need to decide is the same: where the vehicle is, what it is holding, what it was doing, and who is now stuck behind it. The guide path draws no distinction at all -- a flat battery, a breakdown and an operator stopping the line are one event to it -- so the distinction lives here, where the response is decided.

An interruption is handed to the vehicle's InterruptionPolicyIfc, which runs as a process and may do anything a process may do: wait for a technician, delay for travel and assessment, tow the vehicle out of the way. The policy has no return value. When it returns, the framework asks the same question the movement gate asks -- is this vehicle fit to carry on? -- and acts on the answer. A repair that finished leaves a repaired vehicle, so it continues; a charge policy that did nothing leaves a flat vehicle, so it does not. One predicate, and no way for a policy to claim it fixed something it did not.

Inheritors

Constructors

Link copied to clipboard
protected constructor(vehicle: FleetVehicle, at: Double, location: String, heldZones: List<Zone>, wasDoing: TransporterState, task: Dispatcher.Task?, loadIsAboard: Boolean)

Types

Link copied to clipboard

The vehicle has broken down.

Link copied to clipboard

The vehicle has run out of charge.

Properties

Link copied to clipboard
val at: Double

when it stopped

Link copied to clipboard

the zones it is denying to everyone else while it stands there

Link copied to clipboard

True when at least one vehicle is being held up by this one at this instant.

Link copied to clipboard

True when the vehicle is standing somewhere traffic with business elsewhere has to pass.

Link copied to clipboard

whether it is carrying the load it was given

Link copied to clipboard

where it stopped, as a network location name

Link copied to clipboard

The vehicles standing still right now because this one is in their way.

Link copied to clipboard

the work in hand, or null if it had none

Link copied to clipboard

the vehicle that stopped

Link copied to clipboard

what it was doing at the moment it stopped