Inventory
A stocking point for a single ItemType. Holds inventory, fills customer demands, requests replenishment from a supplier, and optionally backlogs demands it cannot fill immediately.
Construct with an InventoryPolicyAbstract that controls when replenishment is requested. A BackLogPolicyAbstract is attached separately by constructing one with this inventory as its parent — the backlog policy's init block establishes the bidirectional link via setBackLogPolicy.
Parameters
the parent model element (must be reachable to a SupplyChainModel so replenishment demands can be created)
the single ItemType this inventory carries
the replenishment policy
initial stock at the start of each replication
whether the inventory may partially fill an incoming demand
optional model-element name
See sc.inventorylayer.Inventory
Constructors
Properties
Whether incoming customer demands may be backlogged here.
Units currently on hand.
Units currently on order (in replenishment).
The inventory's backlog info.
Currently attached backlog policy, or null.
Direct filler override; if set, used instead of demandFillerFinder.
Finder used to locate a filler for each generated demand.
amountOnHand + amountOnOrder − backlog, the usual inventory-position metric used by reorder policies.
All item types this filler is willing to fill.
Counter of lost-sale events (per-replication, post-warmup). Fires when a stockout demand is rejected (either because the demand is non-backloggable, or because this inventory is not configured to allow backlogging). Subset of stockoutCounter — a stockout that gets backlogged is not a lost sale.
Read-only response views for external observers and aggregates.
Current count of replenishment orders observed this replication.
Whether replenishment demands this inventory sends may be backlogged.
Whether replenishment demands this inventory sends may be partially filled.
Policy-level reaction invoked when a replenishment this inventory sent is rejected by its filler. Defaults to an InventoryReplenishmentRejectionListener whose dispatch methods throw (fail-loud). Replace it before simulating with a subclass that handles rejection gracefully — to retry, route to an alternate supplier, or record-and-continue.
Counter of stockout events (per-replication, post-warmup). A stockout fires every time a customer demand arrives and finds amountOnHand < remainingDemand, regardless of whether the demand is then backlogged or rejected. Drives the stockout-cost line in the cost model.
Total units ordered upstream across all replenishment requests in the replication (post-warmup). Incremented by qty at each requestReplenishment(qty) call. Drives variable-quantity ordering-cost formulations.
Total units short across all stockout events in the replication (post-warmup). Incremented by remainingDemand − amountOnHand at each stockout. Drives the unit-shortage-cost line.
Functions
The status demand would receive if filled now. Only valid at the current simulation time.
Fill a previously received demand. Must be called at the same simulation time as the receipt — no time may elapse between receive and fillDemand.
Resets availability to initialAvailability before each replication. The Java original had a typo (intialize) so it never actually overrode the framework hook; this port fixes the override.
True if this sender may produce demands of type.
Returns a DemandMessageIfc describing what would happen if demand were sent now, or null if negotiation is not supported.
Receive demand and place it in SupplyChainModel.received, or reject by transitioning to SupplyChainModel.rejected. The filler may set the demand's SupplyChainModel.Demand.status to indicate the rejection reason but is not required to.
Capture an InventoryCostObservables snapshot of this inventory's current within-replication state. Intended to be called from a cost calculator's ModelElementObserver.replicationEnded(this) callback, when KSL guarantees the within-replication statistics are stable for the post-warmup window.
True if demand would be rejected if filled now.