Link

class Link(source)

A run of guide path between two intersections, divided into an integral number of equal zones.

A link is the unit a modeler specifies and the unit over which zone geometry is uniform. Its length must be an integral multiple of its zone length, so that the space it represents divides evenly into zones that a transporter can claim one at a time. That constraint is checked when the network is built rather than when a transporter first traverses the link, because a geometry error discovered part way through a long run is far harder to diagnose than a rejected specification.

The velocity change factor multiplies a transporter's velocity while it is on this link, which is how a stretch of path that must be taken slowly is represented without distorting its length.

Links are created by the network builder and are immutable apart from the direction lock, which is per-replication state.

Parameters

name

unique within the network

beginIntersection

where a forward traversal starts

endIntersection

where a forward traversal ends, distinct from the beginning

length

the total length in the modeler's units

zoneLength

the length of each of this link's zones

numZones

how many zones divide the link, at least one

type

whether traffic may run one way, both ways, or into a dead end

velocityFactor

multiplies transporter velocity on this link, strictly positive

beginDirection

the compass-style direction of travel in degrees as the link leaves its beginning intersection. Layout and animation metadata only: it does not affect travel time, because turn and acceleration dynamics are outside this subsystem.

Properties

Link copied to clipboard
Link copied to clipboard

The direction currently permitted on a bidirectional link, or null when the link is empty or unidirectional. Reset at the start of every replication.

Link copied to clipboard

True when traffic may run from the ending intersection back toward the beginning.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

How many transporters are waiting to enter this link.

Link copied to clipboard
Link copied to clipboard

The transporter that has reserved this spur so that it can get back out, or null.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Transporters waiting to enter this link, in the order they began waiting.

Link copied to clipboard
Link copied to clipboard

This link's zones, ordered from the beginning intersection toward the ending intersection. Index order is travel order in the forward direction.

Functions

Link copied to clipboard
open override fun toString(): String