ItemType

class ItemType @JvmOverloads constructor(parent: ModelElement, name: String? = null, weight: Double = 1.0, cube: Double = 1.0, leadTime: RVariableIfc? = null) : ModelElement(source)

Models a stock-keeping unit (SKU) within an inventory system. An ItemType is associated with a unit cost, a weight, a cube (length × width × height), and optionally a leadTime distribution used when this item type is stocked at a location with non-zero replenishment lead time.

The caller is responsible for stream-number assignment when constructing the leadTime source; ItemType does not draw values from it directly.

Parameters

parent

the parent model element

name

an optional name; defaults to a generated unique name

weight

the weight per unit, must be > 0; defaults to 1.0

cube

the cube per unit, must be >= 0; defaults to 1.0

leadTime

an optional replenishment lead-time source; may be null See sc.inventorylayer.ItemType

Constructors

Link copied to clipboard
constructor(parent: ModelElement, name: String? = null, weight: Double = 1.0, cube: Double = 1.0, leadTime: RVariableIfc? = null)

Properties

Link copied to clipboard

Cube per unit; must be >= 0. Re-seeded from initialCube at each replication start.

Link copied to clipboard
@set:KSLControl(controlType = ControlType.DOUBLE, lowerBound = 0.0)
var initialCube: Double

The initial cube per unit (>= 0), applied to cube at the start of each replication. A control. Cannot be changed during a replication.

Link copied to clipboard
@set:KSLControl(controlType = ControlType.DOUBLE, lowerBound = 0.0)
var initialWeight: Double

The initial weight per unit, applied to weight at the start of each replication so replications begin under identical settings. A control. Weight must be strictly positive: the control-set path stores a clamped (>= 0) value without throwing, and a value of 0 is rejected when the initial value is applied at replication start. Cannot be changed during a replication (initial values are replication initial conditions); the live weight remains internally managed.

Link copied to clipboard

Optional replenishment lead-time source.

Link copied to clipboard
@set:KSLControl(controlType = ControlType.DOUBLE, lowerBound = 0.0)
var unitCost: Double

Unit cost; must be >= 0. Defaults to 1.0.

Link copied to clipboard

Weight per unit; must be > 0. Re-seeded from initialWeight at each replication start.

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 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
open override fun toString(): String

Includes the model name, the id, the model element name, the parent name, and parent id