holdZoneFor

fun holdZoneFor(holder: ZoneHolderIfc, zone: Zone, duration: Double, action: ZoneHoldActionIfc, onOverlap: ZoneOverlap = ZoneOverlap.RAISE): ZoneRequest(source)

Takes a zone for a stated duration, and gives it back without being asked again.

The commonest case, and the one with the trap in it. The duration is measured from the instant the hold begins, not from the request -- so a closure of twenty minutes on an aisle that takes two minutes to drain occupies the zone for twenty minutes and is outstanding for twenty-two. Measuring from the request instead would silently shorten every closure by however long the drain happened to take, which depends on traffic and so varies between replications: a defect that shows up as a closure duration that is not the one the modeller asked for, and nowhere as an error.

Return

the request, whose ZoneRequest.isGranted says whether the hold began at once

Parameters

holder

who is taking the space

zone

the zone to take, which must be on this guide path

duration

how long to hold it once the hold begins, strictly positive

action

told when the hold begins and when the clock gives it back