GuidedTransporter

class GuidedTransporter @JvmOverloads constructor(val system: GuidedPathSpace, initialPlacement: TransporterPlacement, velocity: RVariableIfc, val lengthInZones: Int = 1, val zoneControlRule: ZoneControlRuleIfc = EndOfZoneControl(), name: String? = null, val physicalLength: Double? = null, val loadCapacity: Int = 1) : Resource, GuidedTransporterCIfc, VehicleMovementIfc, ZoneHolderIfc(source)

Constructors

Link copied to clipboard
constructor(system: GuidedPathSpace, initialPlacement: TransporterPlacement, velocity: RVariableIfc, lengthInZones: Int = 1, zoneControlRule: ZoneControlRuleIfc = EndOfZoneControl(), name: String? = null, physicalLength: Double? = null, loadCapacity: Int = 1)

Properties

Link copied to clipboard

The link holding the transporter up, or null when it is waiting for a zone instead, or not waiting at all.

Link copied to clipboard
open override var awaitedZone: Zone?

The zone the transporter is waiting for, or null when it is not waiting.

Link copied to clipboard
open override var capacity: Int

The current capacity of the resource. In general, it can be 0 or greater

Link copied to clipboard

How much of the capacity was used, as a time-weighted fraction.

Link copied to clipboard

The zone the transporter has reserved and is travelling into, or null when it is not moving.

Link copied to clipboard

The zones the transporter covers, from the rear of the vehicle to its front. Contiguous along its direction of travel, and no longer than its length once it is fully on the guide path.

Link copied to clipboard

Where the transporter is, for animation and for updating what it carries.

Link copied to clipboard

The route being followed, or null when the transporter is not travelling.

Link copied to clipboard
open override val distanceTravelled: Double

How far this transporter has travelled in this replication, in the network's own length units, including the part of a traversal still under way.

Link copied to clipboard

The fraction of time the transporter was full.

Link copied to clipboard
open override val fracTimeBlocked: TWResponseCIfc

The fraction of time spent unable to claim the space ahead. The statistic a free-path model cannot produce, and the one that says how much a fleet is getting in its own way.

Link copied to clipboard
open override val fracTimeMoving: TWResponseCIfc

The fraction of time spent travelling, for or without an entity.

Link copied to clipboard

The fraction of time spent travelling with nothing aboard.

Link copied to clipboard

The fraction of time spent travelling with an entity aboard.

Link copied to clipboard

The zone at the leading edge, or null before the transporter has been placed.

Link copied to clipboard
open override val heldZones: List<Zone>

Every zone the transporter denies to others: the ones it covers, plus the one it is entering.

Link copied to clipboard
open override var homeBase: String?

Where this transporter waits when it has nothing to do, or null when it waits where it stops.

Link copied to clipboard
@set:KSLControl(controlType = ControlType.INTEGER, lowerBound = 0.0, upperBound = 1.0)
open override var initialCapacity: Int

How many units of itself the transporter has to give: one when it is in service, zero when it is not.

Link copied to clipboard

Where this transporter stands at the start of every replication.

Link copied to clipboard

True when it can take no more.

Link copied to clipboard

True when anything at all is aboard.

Link copied to clipboard
open override val isDispatchable: Boolean

Whether this transporter could be sent somewhere if it were asked right now.

Link copied to clipboard
open override var isHalted: Boolean

True while the transporter is stopped at a zone boundary with route left to run.

Link copied to clipboard
open override val isMoving: Boolean

True while the transporter is travelling, whatever the reason.

Link copied to clipboard
open override val isOffShift: Boolean

True while this transporter has been taken off shift.

Link copied to clipboard

True when nothing in the model will make this transporter move again by itself: it carries nobody, has no route under way, and is not itself waiting for anything.

Link copied to clipboard
open override val isUnderTow: Boolean

True while something other than this transporter is moving it.

Link copied to clipboard
open override val lengthInZones: Int

How many whole zones it covers; one unless it was sized in zones.

Link copied to clipboard
open override val loadCapacity: Int

How many loads it may carry at once, which is not its resource capacity.

Link copied to clipboard
open override val loadsPerLoadedMove: ResponseCIfc?

How many loads were aboard each time a loaded movement began.

Link copied to clipboard
open override val manifest: List<ProcessModel.Entity>

The loads currently aboard, in the order they were taken on.

Link copied to clipboard
open override val numLoadsAboard: Int

How many loads are aboard.

Link copied to clipboard

The mean number of loads aboard, over the replication. Null for a single-load transporter.

Link copied to clipboard
open override val numTimesBlocked: CounterCIfc

How many times the transporter has been unable to claim the space ahead.

Link copied to clipboard
open override val operatingTime: Double

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

Link copied to clipboard
open override val physicalLength: Double?

Its length in the network's own units, or null when it was sized in zones instead.

Link copied to clipboard
open override val positionNow: LocationIfc

Where it is now, taken from the zone it holds rather than from currentLocation.

Link copied to clipboard

The zone at the trailing edge, or null before the transporter has been placed.

Link copied to clipboard
open override val spareCapacity: Int

How many more this transporter could take.

Link copied to clipboard
Link copied to clipboard

What the transporter is doing. Named apart from the resource state it inherits, which says whether the resource is busy or idle rather than what the vehicle is up to.

Link copied to clipboard

The direction it faces on a link, which decides where it may go next.

Link copied to clipboard
open override val velocityRV: RandomVariableCIfc

The velocity source.

Link copied to clipboard

How often the velocity is drawn when it is random.

Link copied to clipboard
Link copied to clipboard
open override val zonesEntered: Int

How many zones this transporter has entered in this replication.

Functions

Link copied to clipboard

Asks to be told whenever this transporter reaches the end of a route.

Link copied to clipboard

Installs the gate that is asked, at every zone boundary, whether this transporter may carry on. Replaces any gate already installed; pass null to remove it.

Link copied to clipboard
open override fun beginTravelTo(destination: LocationIfc, purpose: MovePurpose, waiter: ProcessModel.Entity): HoldQueue?

Commands a journey with this transporter's own agent or driver as the waiter.

Link copied to clipboard

Stops telling a listener about arrivals.

Link copied to clipboard

Takes this transporter off shift: it cannot be allocated again until goOnShift, and requests for it wait in whatever pool queue they were made against.

Link copied to clipboard
fun goOnShift()

Puts this transporter back on shift.

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
open override fun isReachable(destination: LocationIfc): Boolean

True when the vehicle could get to destination at all. Always true where every place is.

Link copied to clipboard
open override fun pathDistanceTo(destination: LocationIfc): Double

Distance along the guide path, which on a one-way network is not separation in space.

Link copied to clipboard
open override fun resumeHalted()

Starts a halted vehicle again from where it stopped. Harmless on one that is not halted.

Link copied to clipboard
fun sendTo(destinationName: String): Boolean

Sends an unallocated transporter to a destination, without an entity aboard.

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