RandomOrderCreator

open class RandomOrderCreator @JvmOverloads constructor(val supplyChainModel: SupplyChainModel, name: String? = null) : ModelElement, OrderCreatorIfc(source)

OrderCreatorIfc that builds orders by stochastically including a subset of registered item types. Each item type has an associated probability of being included on a given order and a distribution for the order quantity.

Parameters

supplyChainModel

the supply-chain model whose createOrder / createDemand factories are used

name

optional model-element name

See sc.inventorylayer.RandomOrderCreator

Constructors

Link copied to clipboard
constructor(supplyChainModel: SupplyChainModel, name: String? = null)

Properties

Link copied to clipboard

Whether the orders created allow backlogging.

Link copied to clipboard

Functions

Link copied to clipboard
fun addItemTypeDistribution(type: ItemType, includeDistribution: RVariableIfc = ConstantRV.ONE, amountDistribution: RVariableIfc = ConstantRV.ONE)

Register an item type. The order creator will include type on each order when includeDistribution draws a positive value (> 0.0); when included, the quantity is sampled from amountDistribution.

Link copied to clipboard
open override fun createOrder(): SupplyChainModel.Order?

Creates and returns a new order, or null if no order should be created at this call (e.g., probabilistic skipping).

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

True if createOrder may produce an order containing type.