GuidedTransporterPoolWithQ

open class GuidedTransporterPoolWithQ @JvmOverloads constructor(parent: ModelElement, val system: GuidedPathTransportSystem, transporters: List<GuidedTransporter>, allocationRule: GuidedTransporterAllocationRuleIfc = ClosestByNetworkDistanceRule(), var idleDispositionRule: IdleDispositionRuleIfc = ParkInPlaceRule(), name: String? = null) : AbstractResourcePool<GuidedTransporter> , GuidedTransporterPoolCIfc(source)

A set of interchangeable transporters that entities ask for by the group rather than by name.

An entity that wants carrying does not care which transporter comes, only that one does. The pool holds the fleet, decides which idle transporter to send, and holds the entities that arrive when none is free.

Waiting happens in one place, on the pool, rather than on the individual transporters. That is deliberate: an entity queued against a particular transporter would go on waiting for that one even after a nearer one came free, which is both slower and harder to explain. Whoever has waited longest is woken when any transporter is released, and chooses afresh.

Parameters

parent

the containing model element

system

the runtime whose guide path these transporters run on

transporters

the fleet, which must all belong to that system

allocationRule

which idle transporter to send

idleDispositionRule

what a released transporter does when nothing is waiting. Settable, because where a fleet idles is a design question a study wants to vary rather than a structural property of the pool. It is read at the moment a transporter is released, so a change takes effect from the next release; the shipped rules carry no state, so none needs resetting between replications.

name

a name for the pool

Constructors

Link copied to clipboard
constructor(parent: ModelElement, system: GuidedPathTransportSystem, transporters: List<GuidedTransporter>, allocationRule: GuidedTransporterAllocationRuleIfc = ClosestByNetworkDistanceRule(), idleDispositionRule: IdleDispositionRuleIfc = ParkInPlaceRule(), name: String? = null)

Properties

Link copied to clipboard

Which idle transporter is sent to a pickup.

Link copied to clipboard
@set:KSLStringControl(allowedValues = ["Closest", "Furthest", "LeastUsed", "Cyclical"], comment = "Which idle transporter of the pool is sent to a pickup")
open override var allocationRuleName: String

The allocation rule by name, so a scenario or an app can change it without holding a rule object. Reading it reports the rule's own toString when the rule is one no name stands for -- a ksl.modeling.guidedpath.rules.RandomTransporterRule, say, which takes a stream.

Link copied to clipboard

The transporters of this pool that a movement gate is currently holding, or that are under tow. They are not offered to the allocation rule, and they are here so that a model which installs a gate can report on what its gate is doing.

Link copied to clipboard
open override val hasIdleTransporter: Boolean

True when some transporter of the pool could be sent now.

Link copied to clipboard
Link copied to clipboard
@set:KSLStringControl(allowedValues = ["ParkInPlace", "ReturnToHomeBase"], comment = "What a released transporter does when nothing is waiting for it")
open override var idleDispositionRuleName: String

Where an idle transporter waits, by name, so a scenario or an app can change it without holding a rule object. Reading it reports the rule's own toString when the rule is one no name stands for -- a ksl.modeling.guidedpath.rules.MoveToStagingAreaRule, say, which takes a location.

Link copied to clipboard

The transporters this pool could send right now: allocated to nobody, and able to move.

Link copied to clipboard
open override val numAvailableUnits: Int

How many transporters this pool has to give, which is how many it could actually send.

Link copied to clipboard
Link copied to clipboard
open override val transporters: List<GuidedTransporter>

The fleet, in declaration order, which is the order ties are broken in.

Link copied to clipboard

Entities waiting for any transporter of this pool to become free.

Functions

Link copied to clipboard
protected open override fun initialize()

Clears any state the allocation rule carries, so a replication cannot inherit the end of the one before it. Most rules do nothing here; a rule that takes turns does.

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