MultiEchelonNetwork

open class MultiEchelonNetwork @JvmOverloads constructor(val supplyChainModel: SupplyChainModel, name: String? = null, val transportStrategy: TransportStrategy = TransportStrategy.SharedCarrier(), levelResponses: Boolean = false, enableExternalSupplierShipmentFormation: Boolean = false) : ModelElement, AggregateInventoryResponseIfc(source)

Multi-echelon arborescent tree of nodes. Each node has at most one parent (its supplier) and any number of children (its customers). Two node types are supported today and both implement NetworkNodeIfc:

The root is a LeadTimeDemandFiller (the external supplier) with an infinite supply that produces each item type after a lead time.

Transport between locations is controlled by transportStrategy:

Setting levelResponses = true allocates a per-level AggregateInventoryResponse in addition to the network-wide one so callers can compare echelon performance. Only IHPs feed these aggregates; cross-docks are tracked in level buckets but do not subscribe (they hold no inventory).

Parameters

supplyChainModel

the owning supply-chain model

name

optional model-element name

transportStrategy

how to wire transport between nodes; defaults to TransportStrategy.SharedCarrier with NoDelayDemandCarrier

levelResponses

if true, collect statistics per level too

See also

See sc.mimenetworks.MultiEchelonNetwork

Constructors

Link copied to clipboard
constructor(supplyChainModel: SupplyChainModel, name: String? = null, transportStrategy: TransportStrategy = TransportStrategy.SharedCarrier(), levelResponses: Boolean = false, enableExternalSupplierShipmentFormation: Boolean = false)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Snapshot of formulations currently attached to this network.

Link copied to clipboard

The network's active demand carrier under TransportStrategy.SharedCarrier. Reading or writing under any other strategy throws — use transportStrategy to access the carrier of a time-based variant instead.

Link copied to clipboard

The external supplier acting as the root of the tree.

Link copied to clipboard

All item types known across every IHP in the network.

Link copied to clipboard

Levels for which a per-level aggregate response was created.

Link copied to clipboard
Link copied to clipboard

Per-line Backorder rollup Response from the first attached default formulation, summing the continuous-rate backorder cost across every per-IHP ksl.modeling.supplychain.cost.BackorderCostCalculator. Emits a rate in the time unit of the modeler's backorderRate.

Link copied to clipboard

Top-line total-cost Response from the first attached ksl.modeling.supplychain.cost.DefaultMultiEchelonCostFormulation, or null when no default formulation is attached. Construct one via DefaultMultiEchelonCostFormulation(network, params) after building the topology to populate this accessor.

Link copied to clipboard

Cross-dock-tier rollup Response from the first attached default formulation.

Link copied to clipboard

External-supplier-tier rollup Response from the first attached default formulation.

Link copied to clipboard

IHP-tier rollup Response from the first attached default formulation.

Link copied to clipboard

Per-line LostSale rollup Response from the first attached default formulation, summing per-rejected-demand cost across every per-(IHP, item) ksl.modeling.supplychain.cost.InventoryCostCalculator.

Link copied to clipboard

Per-line Stockout rollup Response from the first attached default formulation, summing the per-stockout-event cost across every per-(IHP, item) ksl.modeling.supplychain.cost.InventoryCostCalculator.

Link copied to clipboard

Per-line UnitShortage rollup Response from the first attached default formulation, summing per-unit-short cost across every per-(IHP, item) ksl.modeling.supplychain.cost.InventoryCostCalculator.

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
fun addItemType(name: String?, leadTime: RVariableIfc): ItemType
fun addItemType(name: String?, leadTime: RVariableIfc, weight: Double): ItemType
fun addItemType(name: String?, leadTime: RVariableIfc, weight: Double, cube: Double): ItemType
Link copied to clipboard

Flip every per-node carrier into "immediate transport" mode so external demand generators (with no pre-registered transport time) can ship through it. Subsequent nodes added after this call also inherit the flag.

Link copied to clipboard

Register a ksl.modeling.supplychain.cost.CostFormulation with this network. Called automatically from ksl.modeling.supplychain.cost.DefaultMultiEchelonCostFormulation's init block; custom formulations should call this directly from their own init block to participate in costFormulations lookup.

Link copied to clipboard
fun attachDemandGenerator(supplier: NetworkNodeIfc, generator: DemandGenerator, transportTime: RVariableIfc? = null, shipmentFormation: ShipmentFormation? = null)
fun attachDemandGenerator(supplier: NetworkNodeIfc, type: ItemType, timeUntilNext: RVariableIfc, name: String? = null, transportTime: RVariableIfc? = null, shipmentFormation: ShipmentFormation? = null): DemandGenerator
Link copied to clipboard
fun attachDemandGeneratorToIHP(supplier: InventoryHoldingPoint, type: ItemType, timeUntilNext: RVariableIfc, name: String? = null, transportTime: RVariableIfc? = null): DemandGenerator

Typed delegate for IHP-only callers.

Link copied to clipboard

Register sender as a no-delay destination of every node-filler on the shared network carrier. Useful when an external demand generator can send to any node via a DemandFillerFinderIfc — this ensures the network carrier knows how to ship filled demands back.

Link copied to clipboard
fun attachIHPToExternalSupplier(ihp: InventoryHoldingPoint, transportTime: RVariableIfc? = null, shipmentFormation: ShipmentFormation? = null)

Typed overload for InventoryHoldingPoint — delegates to the NetworkNodeIfc form.

Link copied to clipboard

Typed overload for InventoryHoldingPoint-only edges.

Link copied to clipboard
fun attachToExternalSupplier(node: NetworkNodeIfc, transportTime: RVariableIfc? = null, shipmentFormation: ShipmentFormation? = null)
Link copied to clipboard
fun attachToSupplier(supplier: NetworkNodeIfc, customer: NetworkNodeIfc, transportTime: RVariableIfc? = null, shipmentFormation: ShipmentFormation? = null)
Link copied to clipboard

Downstream customer nodes of supplier — every node attached via attachToSupplier with supplier as its supplier. Returns an empty list when supplier is a leaf (or unknown). Useful for walking the network's outbound-edge topology, for example when constructing per-edge cost calculators.

Link copied to clipboard

Per-level aggregate response (when levelResponses = true), or null.

Link copied to clipboard

Snapshot of all cross-docks currently in the network.

Cross-docks at a given level, in attachment order.

Link copied to clipboard

Snapshot of all IHPs currently in the network.

IHPs at a given level, in attachment order.

Link copied to clipboard

Look up an item type by name, or null.

Link copied to clipboard

Snapshot of every node (IHP and cross-dock) in the network.

Every node at a given level, in attachment order.

Link copied to clipboard
Link copied to clipboard
fun isCustomer(supplier: NetworkNodeIfc, customer: NetworkNodeIfc): Boolean
Link copied to clipboard
fun MultiEchelonNetwork.resultsReport(title: String = " - Results", confidenceLevel: Double = 0.95): ReportNode.Document

Build a complete results report for this network: a network overview, a cost summary (per formulation, tier × line), and an inventory performance table. Call after model.simulate(), then render with the standard KSL helpers (toMarkdown(), writeHtml(), showInBrowser(), …).

Link copied to clipboard

Wire this aggregate as a downstream observer of r: every observation on r's underlying responses is mirrored onto this aggregate's matching field.

Link copied to clipboard