Zone

sealed class Zone(source)

The atom of contended space on a guide path: the unit that is claimed, covered, and released.

A zone is the single most important concept in the subsystem. Every claim, release, block, and wake-up is expressed in zones; a transporter's position is the contiguous run of zones it covers; and every congestion statistic is a statistic about zones. Links and intersections are both made of zones, which is what lets a route be a flat sequence rather than an alternating structure the movement engine would have to special-case.

Zones are created by the network and are geometrically immutable. What holds them is per-replication state, mutated only by the movement engine, which is why every mutator is internal to this package: exclusivity can only be guaranteed if nothing outside can claim, cover, or release a zone.

The type is sealed so that the engine handles every kind of zone exhaustively, and so that adding a third kind later has to be a deliberate, reviewed change rather than a silent fall-through.

Inheritors

Constructors

Link copied to clipboard
protected constructor()

Properties

Link copied to clipboard

Whom this zone is closing for, or null when it is open to whoever gets there first.

Link copied to clipboard

True when something has claimed or is covering the zone.

Link copied to clipboard

True when something is present without holding the zone.

Link copied to clipboard

Whatever holds the zone, or null when it is free.

Link copied to clipboard
abstract val id: Int

Index of this zone within the network's zone list. Unique and stable.

Link copied to clipboard

True when nothing holds the zone.

Link copied to clipboard

True when a holder covers the zone, as opposed to merely having reserved it.

Link copied to clipboard

Whether traffic with business elsewhere has to pass through this zone.

Link copied to clipboard
abstract val length: Double

The distance a transporter travels to cross this zone, in the modeler's units. Strictly positive for a link zone. Zero is permitted for an intersection zone, which represents a junction treated as a point: crossing it takes no time, but it is still held exclusively.

Link copied to clipboard
abstract val name: String

Unique within the network, and the name used in messages, traces, and statistics.

Link copied to clipboard

How many things are present in this zone without taking exclusive possession of it.

Link copied to clipboard

How many transporters are waiting for this zone.

Link copied to clipboard

Whether the zone is free, spoken for, or covered. Reset at the start of every replication.

Link copied to clipboard
abstract val velocityFactor: Double

Multiplies transporter velocity while crossing this zone. Strictly positive.

Link copied to clipboard

The transporters waiting for this zone, in the order they began waiting.

Functions

Link copied to clipboard

Why this zone would refuse a claim from claimant, or null when claimant could take it.

Link copied to clipboard
override fun toString(): String
Link copied to clipboard
fun traversalTime(velocity: Double): Double

The time for a transporter travelling at the given velocity to cross this zone. Exactly zero for a dimensionless intersection, which schedules a zero-delay event rather than an instantaneous state change, so that the executive keeps the ordering explicit.