firstZoneHeldByStationaryVehicle

The zone of this set that a parked vehicle is standing in, or null when none is.

The companion of firstPromisedZone, and deliberately a separate question rather than an extra reason folded into the same one. "Is this promised to somebody else?" and "is anything parked in it?" are different properties with different remedies, and this subsystem has already paid three defects for treating two different properties as one word. A request refused by a promise fails at once and says so; a request over space a parked vehicle occupies succeeds, waits, and is never granted -- the quiet failure numRequestsUnfilled counts and the end-of-replication report names.

Checking first is what turns that into a decision:

val parked = space.firstZoneHeldByStationaryVehicle(aisle.zones)
if (parked != null) {
dispatch(parked.holder) // move it, clean elsewhere, or postpone
} else {
space.holdZonesFor(crew, aisle.zones, cleanupTime.value, this)
}

It is not a guarantee that a set which passes will drain promptly: a busy aisle takes as long as it takes, and a holder that never releases its own untimed hold is a fault this cannot see. What it rules out is the one hopeless case the guide path can recognise.

Return

the first zone with a parked vehicle in it, or null when none has one

Parameters

zones

the zones a closure would cover