ContainerNode

abstract class ContainerNode<T>(label: String, incoming: List<InputChannel<*, *>>, outgoing: List<OutputChannel<*, *>>) : Node, Container<T>

Base class for nodes that hold entities. Provides callbacks for entity entry and exit events, allowing tracking of occupancy and behavior throughout the simulation.

Parameters

T

the type of entities held

label

the name of this node

incoming

the list of input channels

outgoing

the list of output channels

Inheritors

Constructors

Link copied to clipboard
constructor(label: String, incoming: List<InputChannel<*, *>>, outgoing: List<OutputChannel<*, *>>)

Properties

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

The number of occupants held by the container

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 fun onStart()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String