QueueNode

class QueueNode<T>(label: String, source: PushInputChannel<T>, destination: PullOutputChannel<T>, policy: QueuePolicy<T> = FIFOQueuePolicy()) : ContainerNode<T> , Queue<T>

A queue that receives entities through a push channel and outputs them through a pull channel. Entities are stored and ordered according to the provided QueuePolicy (defaults to FIFO). The queue remains open to receive entities and signals readiness when it contains items.

Parameters

T

the type of entities in the queue

label

the name of this node

source

the input channel from which entities are received

destination

the output channel where entities are sent

policy

the QueuePolicy that determines entity ordering (defaults to FIFO)

Constructors

Link copied to clipboard
constructor(label: String, source: PushInputChannel<T>, destination: PullOutputChannel<T>, policy: QueuePolicy<T> = FIFOQueuePolicy())

Properties

Link copied to clipboard
override val incoming: List<InputChannel<*, *>>
Link copied to clipboard
Link copied to clipboard
open override val occupants: Int

Returns the current number of entities in the queue.

Link copied to clipboard
override val outgoing: List<OutputChannel<*, *>>
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun onEnter(callback: context(Simulator) (T) -> Unit)

Registers a callback to be invoked when an entity enters this container.

Link copied to clipboard
open override fun onLeave(callback: context(Simulator) (T) -> Unit)

Registers a callback to be invoked when an entity leaves this container.

Link copied to clipboard
context(_: Simulator)
open override fun onStart()

Initializes the queue, marking destination ready if there are initial occupants.

Link copied to clipboard
Link copied to clipboard
open override fun supportsResidenceTime(): Boolean

Checks if the QueuePolicy supports residence time tracking.

Link copied to clipboard
open override fun toString(): String