GateStation

class GateStation(parent: ModelElement, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, initiallyOpen: Boolean = true, name: String? = null) : ModelElement, QObjectReceiverIfc, RoutingOutletsIfc, GateStationCIfc(source)

A gate that passes arriving QObject instances straight through while open, and holds them (in arrival order) while closed. Opening the gate releases all held instances. The gate is controlled externally via open and close — for example by a scheduled event, a controller, or an agent reacting to network state — making it the station-view hook for signal/condition control.

Parameters

parent

the model element serving as this station's parent

nextReceiver

where released instances are sent

initiallyOpen

the gate's state at the start of each replication

name

the name of the station

Constructors

Link copied to clipboard
constructor(parent: ModelElement, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, initiallyOpen: Boolean = true, name: String? = null)

Properties

Link copied to clipboard
open override val hasOnwardRouting: Boolean

True if this node has any onward routing configured (a static next receiver, a station-level sender, or a class route). A non-terminal node for which this is false — and which is not a non-terminal step of a registered route — is a dangling node and fails validation.

Link copied to clipboard
open override val isOpen: Boolean

Whether the gate is currently open.

Link copied to clipboard
open override val numHeld: TWResponseCIfc

Time-weighted number of instances currently held at the gate.

Link copied to clipboard
open override val numReleased: CounterCIfc

The number of instances released through the gate.

Functions

Link copied to clipboard
fun close()

Closes the gate so that subsequent arrivals are held.

Link copied to clipboard
protected open override fun initialize()

This method should be overridden by subclasses that need actions performed to initialize prior to a replication. It is called once before each replication occurs if the model element wants initialization. It is called after beforeReplication() is called

Link copied to clipboard

Sets the receiver of released instances.

Link copied to clipboard
fun open()

Opens the gate and releases all held instances in arrival order.

Link copied to clipboard
open override fun outlets(): List<QObjectReceiverIfc>

The statically known receivers this node may route to. Best-effort: empty when the node has no static link or when its routing is opaque (for example, a probabilistic sender whose destinations are not introspectable).

Link copied to clipboard
open override fun receive(arrivingQObject: ModelElement.QObject)