Zone Request
A request for guide-path space: what was asked for, before it has been given.
The middle term of a trio that mirrors the resource layer exactly, which is the analogy this whole construct is built on. A Zone is the persistent thing with its own occupancy, as a Resource is; a ZoneRequest is what somebody asked for and is waiting on, as an Entity.Request is; and a ZoneAllocation is the transient record of the grant, as an Allocation is.
A request exists because a grant is not instant. Between asking and holding, the zone drains: whatever vehicle is crossing it finishes crossing, whatever is present in it leaves, and only then can the zone be given. Nothing is evicted. So there is a state here that the resource layer has no equivalent of -- asked for, promised, not yet held -- and this is the object that has it.
Requests are made by asking the GuidedPathSpace, never by construction: the space has to stay in charge of its own exclusivity, which is the invariant the whole subsystem rests on.
A set is taken all at once or not at all. Taking the zones one by one as they drain is what creates the trap described on ZoneClosureIfc; waiting until every zone has drained and then claiming them together prevents that trap rather than leaving it to be detected. It does not make the holder incapable of lying on a circular wait: sequence and the escape rule on ZoneClosureIfc exist because two closures over abutting regions can wait on each other through their reservations alone, whatever either one holds. The cost of the rule is that a closure over a busy region begins later, and that delay is reported rather than hidden: the space keeps it as a response of its own.
Parameters
who asked
what was asked for, one or more
when it was asked for
where this request falls in the strict order of every request the guide path has taken, which is what the escape rule on ZoneClosureIfc is ordered by
how long to hold the space once the hold begins, or NaN to hold it until the holder gives it back. Measured from the instant the hold begins, never from the request, or a two-minute drain would silently eat two minutes out of a twenty-minute closure.
what to tell when the hold begins and when it ends
Properties
Functions
Three things may take a zone this closure has reserved, and ZoneClosureIfc says why each is needed: the holder it is promised to, which is how the grant is taken up; a vehicle already inside this region, which is how that vehicle leaves; and a vehicle escaping a region reserved before this one, which is what stops two closures trapping each other.