LinkType

@Serializable
enum LinkType : Enum<LinkType> (source)

How traffic may traverse a link.

The choice matters far beyond direction of travel, because it decides which deadlocks are possible. A unidirectional network cannot produce a head-on circular wait at all, which is why it is the default and why the standard advice is to prefer it.

Entries

Link copied to clipboard

Traversable only from the beginning intersection toward the ending intersection.

Link copied to clipboard

Traversable in both directions, but only by one direction of travel at a time. A transporter entering must agree with the direction of any transporters already on the link, which is enforced by the link's direction lock. Bidirectional links are the usual source of head-on deadlock and are worth avoiding where a pair of unidirectional links would serve.

Link copied to clipboard

A dead end: bidirectional, and ending at an intersection with no other incident link. A transporter sent to the far end must keep a claim sufficient to get back out, which is what makes a spur the standard device for keeping a stopped transporter out of the way of traffic.

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Functions

Link copied to clipboard
fun valueOf(value: String): LinkType

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.