InventoryPolicyAbstract

abstract class InventoryPolicyAbstract @JvmOverloads constructor(parent: ModelElement, name: String? = null) : ModelElement(source)

Abstract base for replenishment policies controlled by an Inventory.

Subclasses implement checkInventory (decide when to order), setPolicyParameters and getPolicyParameters (the mutable parameter vector), and setInitialPolicyParameters (the vector restored at the start of each replication).

See sc.inventorylayer.InventoryPolicyAbstract

Inheritors

Constructors

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

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
protected val inventory: Inventory

The associated Inventory, set via setInventory.

Link copied to clipboard
protected val inventoryPosition: Int
Link copied to clipboard

Parameter values restored at the start of each replication. Subclasses store into this from setInitialPolicyParameters.

Link copied to clipboard

True if the policy parameters changed at least once this replication.

Link copied to clipboard

If true (default), the policy parameters are reset to initialPolicyParameters before each replication.

Link copied to clipboard

If false, suppresses the warning logged when the policy parameters changed during a replication and reset is off.

Functions

Link copied to clipboard
protected open override fun beforeReplication()

This method should be overridden by subclasses that need actions performed prior to each replication. It is called prior to each replication and can be used to initialize the model element. It is called before initialize() is called.

Link copied to clipboard
protected abstract fun checkInventory()

Decide whether to place a replenishment order now.

Link copied to clipboard

Snapshot of the initial parameter vector.

Link copied to clipboard

Snapshot the current parameter values.

Link copied to clipboard
protected open override fun removedFromModel()

This method should be overridden by subclasses that need actions performed when a model element is removed from a model

Link copied to clipboard
protected fun requestReplenishment(replenishmentQty: Int)
Link copied to clipboard
abstract fun setInitialPolicyParameters(parameters: DoubleArray)

Replace the parameter vector restored at the start of each replication. Subclasses validate the array shape and contents.

Link copied to clipboard
protected abstract fun setPolicyParameters(parameters: DoubleArray)

Change the policy parameters during a replication.