OrderGenerator

open class OrderGenerator @JvmOverloads constructor(val supplyChainModel: SupplyChainModel, var orderCreator: OrderCreatorIfc? = null, timeUntilFirstRV: RVariableIfc, timeBtwEventsRV: RVariableIfc, maxNumberOfEvents: Long = Long.MAX_VALUE, timeOfTheLastEvent: Double = Double.POSITIVE_INFINITY, name: String? = null) : EventGenerator, OrderSenderIfc(source)

Generates orders at scheduled intervals and routes them to an order filler. The order's content is produced by an OrderCreatorIfc; the filler is located via an OrderFillerFinderIfc or set directly via orderFiller.

Parameters

supplyChainModel

the supply-chain model whose order/demand factories are used

orderCreator

strategy that builds the order at each event

timeUntilFirstRV

time until the first generation event

timeBtwEventsRV

time between subsequent generation events

maxNumberOfEvents

maximum number of events to generate

timeOfTheLastEvent

simulation time at which to stop generating

name

optional model-element name

See sc.inventorylayer.OrderGenerator

Inheritors

Constructors

Link copied to clipboard
constructor(supplyChainModel: SupplyChainModel, orderCreator: OrderCreatorIfc? = null, timeUntilFirstRV: RVariableIfc, timeBtwEventsRV: RVariableIfc, maxNumberOfEvents: Long = Long.MAX_VALUE, timeOfTheLastEvent: Double = Double.POSITIVE_INFINITY, name: String? = null)

Properties

Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard

Finder used to locate a filler for each generated order.

Link copied to clipboard

Functions

Link copied to clipboard
protected override fun generate()

Called on each generator event; if a creator is set, builds, fills, sends.

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

True if this sender may produce orders containing type.

Link copied to clipboard
protected open fun orderDelivered(order: SupplyChainModel.Order)

Called when this generator's order is delivered. Default: no-op.

Link copied to clipboard
protected open fun orderReceived(order: SupplyChainModel.Order)

Called when this generator's order reaches the SupplyChainModel.orderReceived state. Default: asks the filler to fill the order.

Link copied to clipboard
protected open fun orderRejected(order: SupplyChainModel.Order)

Called when this generator's order is rejected. Default: throws IllegalStateException. Subclasses may override to handle.

Link copied to clipboard
protected open fun sendOrder(order: SupplyChainModel.Order)
Link copied to clipboard
protected open fun setFillerForOrder(order: SupplyChainModel.Order)