InventoryHolderAbstract

abstract class InventoryHolderAbstract @JvmOverloads constructor(parent: ModelElement, initialAvailability: Boolean = true, name: String? = null) : DemandFillerAbstract, DemandSenderIfc, AggregateInventoryResponseIfc(source)

Abstract base for objects that hold one Inventory per ItemType and route incoming demands to the appropriate inventory. Acts as a DemandFillerIfc (forwards demands by item type) and a DemandSenderIfc (forwards inventory replenishment demands outward).

Aggregate statistics across the held inventories are exposed via AggregateInventoryResponseIfc (delegated to a member AggregateInventoryResponse).

See sc.inventorylayer.InventoryHolderAbstract

Inheritors

Constructors

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

Properties

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

Read-only view of the time-weighted "fraction of time on-hand > 0".

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override var demandFiller: DemandFillerIfc?

Direct filler override; if set, used instead of demandFillerFinder.

Link copied to clipboard

Finder used to locate a filler for each generated demand.

Link copied to clipboard
open override val itemTypes: Collection<ItemType>

All item types this filler is willing to fill.

Link copied to clipboard

Per-item-type inventories. LinkedHashMap per porting plan §4.3.

Link copied to clipboard

Number of distinct item types held.

Link copied to clipboard

Used by held inventories internally; defaults to a requester that calls back into this holder. Subclasses may swap it.

Functions

Link copied to clipboard
fun addInventory(inventory: Inventory)

Add an Inventory for its declared Inventory.itemType. Subscribes the inventory's responses to this holder's aggregate; sets the inventory's Inventory.replenishmentRequester so its replenishment routes through here.

Link copied to clipboard
fun addReorderPointOrderUpToLevelInventory(type: ItemType, reorderPoint: Int, orderUpToPoint: Int, initialOnHand: Int = 0, name: String? = null): Inventory
Link copied to clipboard
fun addReorderPointReorderQuantityInventory(type: ItemType, reorderPoint: Int, reorderQty: Int, initialOnHand: Int = 0, name: String? = null): Inventory
Link copied to clipboard
open override fun canFillItemType(type: ItemType): Boolean

True if this filler can fill demands of type.

open override fun canFillItemType(demand: SupplyChainModel.Demand): Boolean

True if this filler can fill demands of demand's item type.

Link copied to clipboard

The status demand would receive if filled now. Only valid at the current simulation time.

Link copied to clipboard
abstract override fun fillDemand(demand: SupplyChainModel.Demand)

Fill a previously received demand. Must be called at the same simulation time as the receipt — no time may elapse between receive and fillDemand.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun mightRequest(type: ItemType): Boolean

True if this sender may produce demands of type.

Link copied to clipboard

Returns a DemandMessageIfc describing what would happen if demand were sent now, or null if negotiation is not supported.

Link copied to clipboard
abstract override fun receive(demand: SupplyChainModel.Demand)

Subclasses define how demands are received and filled.

Link copied to clipboard
fun removeInventory(type: ItemType, fromModel: Boolean = false): Inventory

Remove the inventory for type. The associated Inventory model element may optionally be removed from the model.

Link copied to clipboard
protected open fun requestReplenishment(inventory: Inventory, demand: SupplyChainModel.Demand)

Invoked by an internal inventory (via the wired-up replenishment requester) to send its replenishment demand outward. Sets the holder as the demand's sender and uses the holder's filler or finder to dispatch.

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
Link copied to clipboard
open override fun willReject(demand: SupplyChainModel.Demand): Boolean

True if demand would be rejected if filled now.