FleetSystem

abstract class FleetSystem @JvmOverloads constructor(parent: ModelElement, assignmentPolicy: AssignmentPolicyIfc = NearestVehiclePolicy(), name: String? = null) : AgentModel(source)

A fleet of self-directing vehicles, and the dispatcher that tasks them.

Decision-making moved out of the entity's process and into objects that have processes of their own. An entity asks for transport and suspends; it never chooses a vehicle, never waits for a particular one, and cannot tell which one came.

Substrate-independent. Nothing here names a guide path, a projection or a plane. What a subclass supplies is a space -- named places and distances -- and, if its substrate measures anything about a journey, the three hooks below that let it report what it measured. Everything else -- the dispatcher, the tours, the stops, the lines, the control loop that walks them, and the audit that checks the whole account adds up -- is the same whatever the vehicles run on.

AgentModel, and therefore ProcessModel, because the vehicles and the dispatcher are agents with processes and mailboxes, and only an AgentModel can host them. A modeller's own ProcessModel holds this as a child element, and its entities suspend in this system's queues.

Inheritors

Constructors

Link copied to clipboard
constructor(parent: ModelElement, assignmentPolicy: AssignmentPolicyIfc = NearestVehiclePolicy(), name: String? = null)

Properties

Link copied to clipboard

Whether this system audits its own account of itself once, as each replication ends.

Link copied to clipboard

Where a vehicle can charge, in declaration order.

Link copied to clipboard
Link copied to clipboard

Per delivered load: how much of its journey the carrying vehicle spent out of service.

Link copied to clipboard

How many loads were still waiting to be collected when the last replication ended.

Link copied to clipboard

How many loads were still aboard a vehicle when the last replication ended.

Link copied to clipboard

How many vehicles were broken down when the replication ended.

Link copied to clipboard

How many vehicles carry no task: idle to the dispatcher.

Link copied to clipboard

How many vehicles are working a task.

Link copied to clipboard

How many vehicles are stopped and being dealt with -- broken down, waiting for a technician, being pushed out of the way, or out for the rest of the replication.

Link copied to clipboard

How many vehicles were stopped mid-route for want of charge when the replication ended.

Link copied to clipboard
abstract val space: FleetSpaceIfc

The layout this fleet works over: named places, distances between them, and reachability.

Link copied to clipboard

The permanent stops declared on this fleet.

Link copied to clipboard
Link copied to clipboard

How many tasks were still outstanding when the last replication ended.

Link copied to clipboard

In declaration order, which is the order ties are broken in.

Functions

Link copied to clipboard
fun addCharger(locationName: String)

Declares a place in the layout as a charger.

Link copied to clipboard
protected open override fun afterReplication()

Drops this replication's agent references.

Link copied to clipboard

Asks to be told whenever a vehicle in this fleet stops and cannot carry on by itself.

Link copied to clipboard
protected open fun collectCarry(approachTime: Double, rideTime: Double, blockedTime: Double, zonesTraversed: Int, routeLength: Double)

Reports what one delivered load cost the substrate underneath.

Link copied to clipboard

Stops telling a listener about interruptions.

Link copied to clipboard
protected open override fun initialize()

Creates a fresh agent for every vehicle and for the dispatcher, and activates them.

Link copied to clipboard
fun nearestCharger(fromLocationName: String): String?

The declared charger nearest to a place along the layout's own paths, or null when none is reachable from there.

Link copied to clipboard
protected open override fun replicationEnded()

Reports whatever was still in flight when the horizon fell, and wakes nothing.

Link copied to clipboard
protected open fun spaceHeldBy(vehicle: FleetVehicle): String

What space a vehicle is denying to everyone else, for the horizon diagnostic. Empty where a vehicle standing still is in nobody's way.

Link copied to clipboard

Switches reporting for the hold queues. Off by default.

Link copied to clipboard
protected open fun substrateReporting(option: Boolean)

Switches reporting on the substrate's own queues, if it has any.

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

Includes the model name, the id, the model element name, the parent name, and parent id