FleetVehicle

abstract class FleetVehicle @JvmOverloads constructor(val system: FleetSystem, name: String? = null, val loadCapacity: Int = 1, val battery: Battery? = null, val failureModel: FailureModel? = null) : ModelElement, FleetVehicleCIfc(source)

A vehicle: the permanent identity a modeller declares, names, and reads statistics from.

What it is not is the thing that decides, and it is not the thing that occupies space. Those are two other objects, and both are hidden. The vehicle composes a VehicleBodyIfc for its physical presence, because every substrate's body is a Resource and a resource is passive by construction: inheriting one would expose a way to seize this vehicle as though it were a tool, which is exactly the modelling stance this subsystem exists to replace. And it holds a per-replication agent for its behaviour, because a KSLProcess runs once and a vehicle must run in every replication.

Substrate-independent. Nothing here names a guide path, a projection or a plane. What a subclass supplies is a body, a tow, and the two facts an interruption carries about where a vehicle stopped -- which is the only thing about stopping that differs between substrates.

A modeller names only the concrete subclass.

Inheritors

Constructors

Link copied to clipboard
constructor(system: FleetSystem, name: String? = null, loadCapacity: Int = 1, battery: Battery? = null, failureModel: FailureModel? = null)

Properties

Link copied to clipboard

Everything this vehicle is committed to. One at a time while capacity is one.

Link copied to clipboard

the vehicle's energy store, or null for a vehicle whose charge is not modelled. A vehicle with no battery reports no charging statistics, because a row that measures something the model does not have is a question its reader has to answer for themselves every time.

Link copied to clipboard
open override var bidPolicy: BidPolicyIfc

What it offers when a dispatcher calls for proposals. Consulted from the negotiated phase.

Link copied to clipboard

How much of the room was used, time-weighted, or null for a single-load vehicle.

Link copied to clipboard

How long this vehicle has been blocked so far this replication.

Link copied to clipboard
open override val currentAssignment: Assignment?

The task it is committed to, or null.

Link copied to clipboard
open override val currentLocationName: String

Where the vehicle is, as a place name, updated while it travels.

Link copied to clipboard

How fast it is going now, which is not the mean of its velocity distribution.

Link copied to clipboard

What it does with itself when the dispatcher has no work. Per vehicle, so a fleet may be heterogeneous.

Link copied to clipboard

How far this vehicle has travelled in this replication, in the layout's own length units.

Link copied to clipboard

when the vehicle breaks down and how long it takes to repair, or null for a vehicle that does not fail. Like battery, a vehicle without one reports no failure rows.

Link copied to clipboard

How much of the time it was full, or null for a single-load vehicle.

Link copied to clipboard
open override val fracTimeBlocked: TWResponseCIfc

Fraction of time stopped by space it could not have; flat zero on a free path.

Link copied to clipboard

The fraction of time spent on a charger. Registered only for a vehicle that has a battery.

Link copied to clipboard

The fraction of time the vehicle was broken down. Registered only if it can fail.

Link copied to clipboard
open override val fracTimeMoving: TWResponseCIfc

Fraction of time travelling, loaded or empty.

Link copied to clipboard

Fraction of time travelling empty.

Link copied to clipboard
open override val fracTimeOnTask: TWResponseCIfc

Fraction of time committed to a task, whether moving or standing.

Link copied to clipboard

Fraction of time travelling with a load aboard.

Link copied to clipboard

stateOfCharge as a fraction of capacity, or NaN for a vehicle with no battery.

Link copied to clipboard
open override val hasAssignment: Boolean

True when the vehicle is committed to anything at all.

Link copied to clipboard
open override var homeBase: String?

Where the vehicle waits when it has nothing to do, or null to wait where it stops.

Link copied to clipboard

What happens when this vehicle stops and cannot carry on by itself.

Link copied to clipboard

True when there is no room for another load. The complement of spareCapacity being zero.

Link copied to clipboard
open override val isAvailable: Boolean

True when it has declared itself available and holds no assignment. Asserted by the vehicle, never inferred by the dispatcher.

Link copied to clipboard

True when anything is aboard.

Link copied to clipboard
open override var isFailed: Boolean

True while the vehicle is broken down.

Link copied to clipboard

True when the vehicle has no charge left. Always false for a vehicle with no battery.

Link copied to clipboard
open override var isOutOfService: Boolean

True from the moment the vehicle stops until its policy has put it right -- and thereafter, for good, if the policy did not.

Link copied to clipboard

True while the vehicle is stopped mid-route because it ran out of charge.

Link copied to clipboard

True while somebody is moving it rather than it moving itself.

Link copied to clipboard
open override val loadCapacity: Int

How many loads this vehicle can carry at once.

Link copied to clipboard

How many loads a loaded move carried, or null for a single-load vehicle.

Link copied to clipboard
open override val loadsPerTour: ResponseCIfc?

How many loads each completed round carried.

Link copied to clipboard

What is aboard, in the order it came aboard.

Link copied to clipboard

The lowest charge the vehicle was seen to hold during the replication, one observation per replication.

Link copied to clipboard

How fast this vehicle travels, as most recently sampled.

Link copied to clipboard

Loads that were aboard, bound for a stop this vehicle was told past, and stayed on.

Link copied to clipboard

How many times the vehicle charged. Registered only for a vehicle that has a battery.

Link copied to clipboard

How many times the vehicle failed. Registered only if it can fail.

Link copied to clipboard

How many loads are aboard.

Link copied to clipboard

The mean number aboard, or null for a single-load vehicle.

Link copied to clipboard

How much expressing this vehicle did. Zero for a fleet whose control never says Skip.

Link copied to clipboard
Link copied to clipboard
open override val numTimesBlocked: CounterCIfc

How many times it was stopped by space it could not have.

Link copied to clipboard

How many times the vehicle stopped mid-route for want of charge.

Link copied to clipboard

How long this vehicle has been anything other than idle in this replication.

Link copied to clipboard

Who is aboard without a task, in the order they boarded.

Link copied to clipboard

How many more loads this vehicle could take.

Link copied to clipboard

How much charge is left, or NaN for a vehicle with no battery.

Link copied to clipboard
open override var stopControl: StopControlIfc

Who decides, stop by stop, whether this vehicle serves the next place in its tour.

Link copied to clipboard
Link copied to clipboard

How long the vehicle was out of service, one observation per failure.

Link copied to clipboard

How many units of discretised space it has entered this replication.

Functions

Link copied to clipboard
protected abstract fun failureInterruption(failureNumber: Int, repairTime: Double): Interruption.Failed

Builds the interruption for a breakdown, with whatever facts about where it stopped the substrate can supply -- what space it is denying to others, and what it was doing.

Link copied to clipboard
protected open override fun initialize()

This method should be overridden by subclasses that need actions performed to initialize prior to a replication. It is called once before each replication occurs if the model element wants initialization. It is called after beforeReplication() is called

Link copied to clipboard

Builds the interruption for a flat battery. See failureInterruption.

Link copied to clipboard
protected open override fun replicationEnded()

Records the replication's lowest charge.

Link copied to clipboard

Who aboard is bound for location.

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

Link copied to clipboard
protected abstract fun towJourney(location: String, waiter: ProcessModel.Entity): HoldQueue?

Commands the substrate to move this vehicle while it is under tow.