Example of a route map of cities connected by routes which record distance and travel time between cities along that specific route.

By: ThorstenSeitz
Values
exampleSource Codeshared example example

This example combines a concrete RouteMap with a named list of the cities forming its vertices.

Functions
kmSource Codeshared Distance km(Integer kilometers, Integer meters = 0)

Convenience function to create a Distance.

Parameters:
  • meters = 0
By: ThorstenSeitz
periodSource Codeshared Period period(Integer hours, Integer minutes)

Convenience function to create periods from hours and minutes only.

By: ThorstenSeitz
printPathInfoSource Codeshared void printPathInfo(RouteMap routeMap, Walk<City,Route> shortestPath)

Example code demonstrating how to calculate different distances on a path or walk.

Classes
CitySource Codeshared final City

A city (Value Object).

DistanceSource Codeshared final Distance

Distance measured in km (Value Object).

RouteSource Codeshared final Route

A route between two cities.

RouteMapSource Codeshared final RouteMap

A route map of cities connected by undirected routes with a given distance and travel time. The same cities may be connected by multiple routes (e.g. Autobahn or Bundesstraße) with different distances and travel times. The route map is therefore a Multigraph.

exampleSource Codeshared example

This example combines a concrete RouteMap with a named list of the cities forming its vertices.