Line

class Line @JvmOverloads constructor(val name: String, val stops: List<LineStop>, val cyclic: Boolean = true)(source)

A fixed sequence of stops a service runs, cycle after cycle.

A specification: declared once, shared by every vehicle that runs it, and never consumed. It is the third of the three ways a tour comes into existence -- declared here, planned by a tour policy from committed tasks, or written out by a modeller -- and the only one in which the same itinerary recurs.

One cycle is one tour, built fresh from the line each time it is assigned. That keeps Tour what it is -- consumed, with a cursor that only advances -- rather than making it circular, and it puts a decision point at the end of every cycle: the vehicle declares itself available and the dispatcher decides whether it runs the line again, runs another, or goes to the depot. The life of one tour is then the cycle time, which is the number a route study is usually about.

Parameters

name

what the service is called

stops

where it calls, in order

cyclic

true for a loop that comes back to where it started, which adds a final leg to the first stop's location so that the cycle time is a whole round and the vehicle finishes in position for the next one. False for a line that ends where its last stop is, which is the shape of a terminal-to-terminal run whose return is a separate line.

Constructors

Link copied to clipboard
constructor(name: String, stops: List<LineStop>, cyclic: Boolean = true)

Properties

Link copied to clipboard
Link copied to clipboard

Every place this line calls at. What a boarding action tests a destination against.

Link copied to clipboard
Link copied to clipboard

Where it starts, which is where a vehicle assigned the line goes first.

Link copied to clipboard
Link copied to clipboard

Where a cycle ends: back at the start for a loop, at the last stop otherwise.

Functions

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