Builder

Adds links, intersections, and station aliases, then produces the network.

A builder validates each piece as it is added, so a mistake is reported against the line that made it rather than against the finished network.

Functions

Link copied to clipboard

Validates the whole specification, computes the distance matrix, and returns the finished network.

Link copied to clipboard
fun intersection(name: String, length: Double = 0.0, velocityFactor: Double = 1.0, x: Double = Double.NaN, y: Double = Double.NaN, z: Double = 0.0): GuidedPathNetwork.Builder

Gives a junction a length, a velocity factor, or layout coordinates.

Link copied to clipboard

Adds a fully specified link.

fun link(name: String, from: String, to: String, length: Double, zoneLength: Double, type: LinkType = LinkType.UNIDIRECTIONAL, velocityFactor: Double = 1.0, beginDirection: Double = 0.0): GuidedPathNetwork.Builder

Adds a link whose zone size is known, deriving how many zones divide it. Intersections are created on first mention.

Link copied to clipboard
fun linkWithZoneCount(name: String, from: String, to: String, length: Double, numZones: Int, type: LinkType = LinkType.UNIDIRECTIONAL, velocityFactor: Double = 1.0, beginDirection: Double = 0.0): GuidedPathNetwork.Builder

Adds a link whose zone count is known, deriving the zone size. This form cannot produce a geometry mismatch and is the safer choice when the count is what the modeler knows.

Link copied to clipboard

Replaces the rule that decides which way transporters go. The default sends every transporter along the shortest path.

Link copied to clipboard
fun station(alias: String, intersectionName: String): GuidedPathNetwork.Builder

Gives an intersection an additional name that process code may address it by.