Guided Path Network
The static topology of a guide path: its intersections, links, zones, station aliases, and the shortest-path distances between every reachable pair of intersections.
A network is a spatial model, so its intersections are locations that the rest of the library already understands: an entity's current location may be an intersection, and the animation inventory can enumerate the named places before a run starts. It answers "how far is A from B" by shortest path through the guide path rather than in a straight line, which is the only answer that means anything on a fixed path.
A network is immutable once built and holds no reference to a model, a model element, or a transporter. It can therefore be constructed, validated, and queried with no simulation running, which is what makes the topology testable on its own. Everything that changes during a run -- which transporter holds which zone -- belongs to the runtime that attaches to the network, not to the network itself.
That split is not merely tidy: a spatial model and a model element are both abstract classes, and one class cannot be both, so the topology and the runtime have to be separate objects. Making the topology the immutable half means nothing about the guide path can differ between replications.
Build one with the step-wise builder, which refuses to produce an inconsistent network:
val net = GuidedPathNetwork.builder("AGVNet")
.link("L1", "I1", "I2", length = 48.0, zoneLength = 12.0)
.link("L2", "I2", "I3", length = 36.0, zoneLength = 12.0)
.station("EntryStation", "I1")
.build()Intersections are created implicitly the first time a link names them, so a network of point junctions needs no intersection declarations at all.
Types
Properties
The runtime operating this network, or null when none has attached.
The location the spatial model uses when none is given. Set to the first declared intersection when the network is built, and settable afterwards to any intersection of this network.
The intersections, in declaration order, which is the index order of the distance matrix.
The intersections and their station aliases, so that the animation layer can discover the addressable places before a run begins.
The rule that decides which way transporters go on this network.
Additional names by which process code may address intersections.
Functions
For this model, two locations are the same only when they are the same intersection.
This network expressed as data, which reconstructs an equivalent network through fromData. Derived quantities are not carried: they are recomputed on reconstruction.
The shortest-path distance from one intersection to another through the guide path.
The intersection with this name, or null. Station aliases are not consulted.
The junction a zone belongs to, for measuring how far a transporter standing there has to go.
True when some path runs from one intersection to the other.
The intersection this name addresses, whether it is an intersection name or a station alias, or null when the name addresses neither.
The intersection this name addresses.
Plans a route from one intersection to another.
Plans a route from wherever a transporter currently stands, which may be part way along a link.
This network as JSON, which reconstructs an equivalent network through fromJson.
The zones of the shortest path, ignoring the route selection rule.
The zones a transporter could enter in one step from this one, given the direction it faces.