SpatialModelFleetSpace

class SpatialModelFleetSpace @JvmOverloads constructor(val model: SpatialModel, places: List<LocationIfc> = model.namedLocations) : FleetSpaceIfc(source)

Any spatial model with named locations, seen as a layout a fleet can work over.

Everywhere is reachable from everywhere, which is what a free path means and is the honest answer for a plane, a grid, or a table of pairwise distances: there are no one-way aisles and no places a vehicle cannot get to. A layout with genuine unreachability -- a guide path -- says so for itself rather than through this.

Parameters

model

the spatial model the places belong to and whose metric measures between them

places

the named places a vehicle can be sent to. Defaults to the model's own SpatialModel.namedLocations, which a DistancesModel maintains and a plane does not: a plane has no bounded set of places, so a fleet over one says which points it calls at

Constructors

Link copied to clipboard
constructor(model: SpatialModel, places: List<LocationIfc> = model.namedLocations)

Properties

Link copied to clipboard

The places this layout knows, in the order the spatial model reports them.

Link copied to clipboard
Link copied to clipboard
open override val name: String

What the layout is called, for messages that have to name it.

Functions

Link copied to clipboard
open override fun distance(fromLocation: LocationIfc, toLocation: LocationIfc): Double

How far apart two places are, by this layout's own metric.

Link copied to clipboard
open override fun isReachable(fromLocation: LocationIfc, toLocation: LocationIfc): Boolean

True when toLocation can be reached from fromLocation at all.

Link copied to clipboard
open override fun location(name: String): LocationIfc?

The place this name refers to, or null when the layout has no such place.

Link copied to clipboard
open override fun requireLocation(name: String): LocationIfc

The place this name refers to. Raises when there is none, naming what was asked for.

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