seizeZones

open suspend fun seizeZones(space: GuidedPathSpace, zones: List<Zone>, queue: HoldQueue, requestPriority: Int = QUEUE_PRIORITY, suspensionName: String? = null, onOverlap: ZoneOverlap = ZoneOverlap.RAISE): ZoneAllocation(source)

Takes a set of zones together, waiting for all of them to drain, and suspends until held.

All or nothing, and that is a rule rather than a convenience: an entity that held part of a region while waiting for the rest could be waiting on a vehicle that is waiting on the part it holds. The rule prevents that outright, and it is also why ProcessModel.Entity.awaitedZone can honestly be null -- an entity is never both holding space and queuing for more. Traffic already inside the region is let out rather than trapped, which is what makes the drain terminate however busy the region is.

The extent is chosen here, at run time, and costs nothing: a link's zones by name, a junction's zone, a zone at a station, or a sample drawn from the network.

inner class Spill : Entity() {
val cleanup = process {
val aisle = network.link("Aisle${myAisle.value.toInt()}")!!
seizeZones(system, aisle.zones.take(myExtent.value.toInt()), cleanupQ)
delay(myCleanupTime)
releaseZones(system)
}
}

Return

the hold, which names the zones and when the hold began

Parameters

space

the guide path whose space is wanted

zones

the zones to take, all on that guide path, distinct, at least one

queue

where to wait while they drain

requestPriority

orders this entity against others queued at the same instant

suspensionName

names this suspension point when a process has several