ZoneAllocation

The record of guide-path space actually held: which holder, which zones, from when until when.

Transient, as an Allocation is, and created by the space rather than by the holder. That is not a stylistic preference: exclusivity can only be guaranteed if nothing outside the space can mint a claim on it, which is why the constructor is internal and why a holder asks rather than takes.

What it is for is the statistics. A zone cannot usefully keep them -- a network has thousands of zones and almost none will ever be held by anything but a vehicle -- so the space keeps four aggregates and this object carries whatever a particular model wants to know about a particular closure. timeHeld and ZoneHoldActionIfc together are how a modeller collects per-closure numbers without the library guessing which closures are worth separating.

Parameters

request

what was asked for, which is where the holder, the zones and the action come from -- an allocation keeps no second copy of any of them

engagedAt

when the hold began

Properties

Link copied to clipboard
Link copied to clipboard

Who holds the space.

Link copied to clipboard

True once the zone has been given back.

Link copied to clipboard

When the hold ended, or NaN while it is still held.

Link copied to clipboard
Link copied to clipboard

When the space was asked for, which is not when the hold began unless nothing had to drain.

Link copied to clipboard

How long the space took to drain: the hold's beginning, less the instant it was asked for.

Link copied to clipboard
val zone: Zone

The single zone held, when exactly one is.

Link copied to clipboard

What is held, one or more zones, taken together and given back together.

Functions

Link copied to clipboard

How long the zone was held, or has been held so far.

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