Package-level declarations

Types

Link copied to clipboard

Destination-side hook fired when a demand transitions into ksl.modeling.supplychain.DemandStateId.Delivered. The endpoint is responsible for advancing the demand to its terminal state — by calling demand.store() (for storing destinations) or by triggering a re-ship via demand.ship() (for pass-through destinations such as cross-docks with downstream routing).

Link copied to clipboard
open class DemandForwarder @JvmOverloads constructor(parent: ModelElement, val upstreamSupplier: () -> DemandFillerIfc?, val sender: DemandSenderIfc, val onUpstreamDelivered: (original: SupplyChainModel.Demand) -> Unit? = null, val shouldFillOnReceive: (DemandFillerIfc) -> Boolean = { true }, name: String? = null) : ModelElement, DemandFillerIfc

A DemandFillerIfc that doesn't fulfil demands from local stock — instead it forwards each incoming demand to an upstream supplier, waits for delivery, and runs a user-supplied callback when the upstream delivers. Analogous to a real-world freight forwarder or drop-shipper: takes the order, places it with a supplier, takes delivery, hands the goods to the original customer.

Link copied to clipboard

Named lifecycle hooks for SupplyChainModel.Demand state transitions. Implement only the hooks you care about; the others default to no-op.

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

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.

Link copied to clipboard
sealed class DockTerminalAction

Terminal action a Dock performs once its service-time delay elapses for an arriving demand.

Link copied to clipboard

Named lifecycle hooks for SupplyChainModel.Order state transitions. Implement only the hooks you care about; the others default to no-op.

Link copied to clipboard

Default delivery endpoint for storing destinations. On every Delivered transition, immediately calls demand.store(), advancing the demand to Stored at the same simulation time.

Link copied to clipboard
interface RoutingTableIfc

Lookup table mapping a demand's final destination (SupplyChainModel.Demand.demandSender) to the next intermediate hop along its multi-hop journey. Used by a DockTerminalAction.Ship (or any custom re-ship endpoint) to decide where to forward an arriving demand.

Functions

Link copied to clipboard

Fulfill this demand in full and dispatch it onward via carrier, or transition directly through shipdeliver if carrier is null.

Link copied to clipboard

Attach observer to this demand. Returns the underlying DemandStateChangeListener so callers can remove the subscription later via SupplyChainModel.Demand.removeStateChangeListener.

Attach observer to this order. Returns the underlying OrderStateChangeListener so callers can remove the subscription via SupplyChainModel.Order.removeStateChangeListener.

Link copied to clipboard

Accept this demand and start processing it: transitions it through RECEIVED → IN_PROCESS at receiver. Equivalent to the two-call sequence receive(receiver); process(receiver) but named for the intent ("the receiver has taken the demand and is now responsible for finishing it").