Dock

open class Dock @JvmOverloads constructor(parent: ModelElement, serviceTime: RVariableIfc = ConstantRV.ZERO, val terminalAction: DockTerminalAction = DockTerminalAction.Store, name: String? = null) : ModelElement, DeliveryEndpointIfc(source)

Single-server discrete-event dock that interposes a service-time delay between a demand reaching DemandStateId.Delivered and the terminal action (store or ship) chosen by the dock's configuration.

Assigned to a destination's ksl.modeling.supplychain.inventory.NetworkNodeIfc.deliveryEndpoint slot to model unload-time behaviour at that node. Replaces the default PassThroughStorageEndpoint (which has zero service time) with a configurable service-time variant.

The default implementation is a strict FIFO single-server queue with statistics matching a service station:

Subclasses may override beginService and applyTerminalAction to integrate with KSL's process-view modelling (resources, transporters, conveyors) — that's the long-term integration path for a ProcessViewDock.

Parameters

parent

the model element that owns this dock (typically the ksl.modeling.supplychain.inventory.NetworkNodeIfc whose deliveryEndpoint slot this dock fills)

serviceTime

per-demand service time distribution; default ConstantRV.ZERO (degenerate to immediate pass-through)

terminalAction

what to do once service ends — default DockTerminalAction.Store

name

optional model-element name

Constructors

Link copied to clipboard
constructor(parent: ModelElement, serviceTime: RVariableIfc = ConstantRV.ZERO, terminalAction: DockTerminalAction = DockTerminalAction.Store, name: String? = null)

Properties

Link copied to clipboard

True iff a demand is currently being serviced.

Link copied to clipboard

Count of demands that finished service this replication.

Link copied to clipboard

Current number of demands waiting in the queue.

Link copied to clipboard

Service-time distribution. Reassigning swaps the underlying source on the inner RandomVariable (per porting-plan §4.1).

Link copied to clipboard
Link copied to clipboard

Per-observation time-in-dock response (arrival → service end).

Link copied to clipboard

Time-weighted utilisation (busy fraction).

Functions

Link copied to clipboard
protected open fun applyTerminalAction(demand: SupplyChainModel.Demand)

Hook fired when service ends for demand. Default invokes the configured terminalAction — calling demand.store() or routing + re-ship per DockTerminalAction.Ship.

Link copied to clipboard
protected open fun beginService(demand: SupplyChainModel.Demand)

Hook fired when demand becomes the in-service demand. Default schedules a service-end event after a sampled service time. Subclasses may override to integrate with KSL process-view primitives (e.g. seize a resource, run a Process block).

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 onDelivered(demand: SupplyChainModel.Demand)

Called by the framework Delivered observer when demand transitions into Delivered at this endpoint's destination.