OrderMessage

class OrderMessage(val orderFiller: OrderFillerIfc, val timeStamp: Double) : OrderMessageIfc(source)

Default implementation of OrderMessageIfc. Built up by an OrderFillerIfc one demand at a time via add.

Parameters

orderFiller

the filler producing this message

timeStamp

simulation time at which the message was created

See sc.inventorylayer.OrderMessage

Constructors

Link copied to clipboard
constructor(orderFiller: OrderFillerIfc, timeStamp: Double)

Properties

Link copied to clipboard
open override val canFillItemTypes: Boolean

Returns false for an empty message (i.e., before add has been called) — matches the Java behavior.

Link copied to clipboard
open override val demandMessages: List<DemandMessageIfc?>

Read-only view of the per-demand messages. Entries may be null.

Link copied to clipboard

True iff no demand messages have been added yet.

Link copied to clipboard
open override val orderFiller: OrderFillerIfc
Link copied to clipboard
val size: Int

Number of demand messages added so far.

Link copied to clipboard
open override val timeStamp: Double

Functions

Link copied to clipboard
fun add(message: DemandMessageIfc?)

Appends a per-demand message. A null entry — or a message whose DemandMessageIfc.canFillItemType is false — permanently flips canFillItemTypes to false. The legacy Java code de-referenced the message before the null check (NPE bug); this port fixes the order.

Link copied to clipboard
fun get(index: Int): DemandMessageIfc?

Returns the demand message at index, or null if a null was added there.