LinkData

@Serializable
data class LinkData(var name: String, var fromIntersection: String, var toIntersection: String, var length: Double, var zoneLength: Double, var numZones: Int, var type: LinkType = LinkType.UNIDIRECTIONAL, var velocityFactor: Double = 1.0, var beginDirection: Double = 0.0)(source)

A run of guide path, as it appears in a serialized network specification.

Both the zone length and the zone count are carried even though either determines the other given the length. That redundancy is deliberate: it makes the specification self-describing, and it lets a validation failure report which of the three quantities the modeler actually supplied rather than guessing. The three are required to agree, within the library's default numerical precision so that a length written as a product of decimals is not rejected for a rounding error the modeler cannot see.

Prefer the companion factory functions to the constructor: they derive the redundant quantity instead of asking for it, which removes the commonest way to write an inconsistent link.

Parameters

name

unique within the network

fromIntersection

the name of the beginning intersection

toIntersection

the name of the ending intersection, different from the beginning

length

the total length in the modeler's units, strictly positive

zoneLength

the length of each zone, strictly positive

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

direction of travel in degrees leaving the beginning intersection. Layout metadata only: it does not affect travel time.

Constructors

Link copied to clipboard
constructor(name: String, fromIntersection: String, toIntersection: String, length: Double, zoneLength: Double, numZones: Int, type: LinkType = LinkType.UNIDIRECTIONAL, velocityFactor: Double = 1.0, beginDirection: Double = 0.0)

Types

Link copied to clipboard
object Companion

Properties

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