distance

open override fun distance(fromLocation: LocationIfc, toLocation: LocationIfc): Double(source)

The shortest-path distance from one intersection to another through the guide path.

The distance accumulated along a path is the sum, over each link traversed, of that link's length plus the length of the intersection it enters. Counting the entered intersection is what keeps this figure equal to the total length of the zones a transporter actually crosses; with the usual point junctions, whose length is zero, it reduces to the sum of link lengths.

Return

the distance, or zero when the two are the same intersection

Parameters

fromLocation

an intersection of this network

toLocation

an intersection of this network

Throws

when either location belongs to another spatial model

when no path exists