SupplyChainModel

open class SupplyChainModel(parent: ModelElement, name: String? = null) : ProcessModel(source)

A model element that hosts a supply-chain submodel. Acts as the umbrella within which Demands and Orders live, mirroring how ProcessModel hosts Entity. Multiple SupplyChainModel instances can coexist within a single KSL ksl.simulation.Model.

Extends ProcessModel so supply-chain elements can also participate in process-oriented modeling (entities, resources, KSL processes).

Demands and orders are created via createDemand and createOrderPlaceholder; their constructors are not exposed.

See sc.inventorylayer.Demand See sc.inventorylayer.Order

Constructors

Link copied to clipboard
constructor(parent: ModelElement, name: String? = null)

Types

Link copied to clipboard
open inner class Demand : ModelElement.QObject

A demand for a quantity of an ItemType. Flows through the supply chain via a state machine; see DemandState. Listeners can be attached to react to state transitions.

Link copied to clipboard
open inner class DemandLoad : ModelElement.QObject

A bundle of demands all destined for the same DemandSenderIfc. Used by transportlayer load-builders and load carriers. Created only via SupplyChainModel.createDemandLoad.

Link copied to clipboard
abstract inner class DemandState

State in the demand lifecycle. State subclasses encapsulate the legal transitions; an attempted illegal transition throws IllegalStateException via unsupported.

Link copied to clipboard
open inner class Order : ModelElement.QObject

A replenishment order containing one or more Demands for distinct ItemTypes. Like Demand, an order moves through a state machine (see OrderState).

Link copied to clipboard
abstract inner class OrderState

State in the order lifecycle. State subclasses encapsulate the legal transitions; an attempted illegal transition throws IllegalStateException via unsupported.

Properties

Link copied to clipboard

Demand is in the backlog awaiting future supply.

Link copied to clipboard

Demand was cancelled.

Link copied to clipboard

Demand has been delivered. Not terminal: the destination's delivery endpoint then transitions either to stored (the normal storing case) or back to shipped (multi-hop pass- through, e.g. a cross-dock re-shipping toward the next hop).

Link copied to clipboard

Demand has been filled.

Link copied to clipboard

Demand is being prepared to be sent or negotiated.

Link copied to clipboard

Demand is being filled.

Link copied to clipboard

Demand is being negotiated.

Link copied to clipboard

Just created, no demands yet.

Link copied to clipboard
Link copied to clipboard

Has at least one demand; not yet sent.

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

Demand is ready to be processed at a filler.

Link copied to clipboard

Demand has been rejected.

Link copied to clipboard

Demand has been sent to a filler.

Link copied to clipboard

Demand has been shipped.

Link copied to clipboard

Demand has been integrated into the destination's inventory (or otherwise finalised at the destination). Terminal state. Accounting listeners (e.g. an Inventory's replenishment handler) fire on this transition rather than on delivered.

Functions

Link copied to clipboard
fun createDemand(itemType: ItemType, amountDemanded: Int = 1, demandName: String? = null): SupplyChainModel.Demand

Creates a new demand within this supply-chain model. The demand starts in inPreparation.

Link copied to clipboard

Creates a new DemandLoad within this supply-chain model. Used by transportlayer load builders and load carriers.

Link copied to clipboard
fun createOrder(orderName: String? = null, allowBackLogging: Boolean = true, allowPartialShipping: Boolean = false, allowCancelling: Boolean = false): SupplyChainModel.Order

Creates a new order within this supply-chain model. Starts in orderCreated; add demands via Order.addDemand before sending.