SourceStation

A SourceStation generates QObject instances according to an arrival process and injects them into a StationNetwork. It is the self-contained special case of a NetworkIngress that also creates the arriving instances.

Instances are created by the station and may be marked (typed, given attributes, or assigned their own value object) via the supplied marking action before they enter the network. Externally created instances can also be injected by calling receive directly, which makes the source a true open boundary.

Typically created via StationNetwork.source.

Parameters

network

the network this source feeds

interArrivalRV

the time between successive arrivals

firstReceiver

the receiver that processes generated instances

timeUntilFirstRV

the time until the first arrival

maxArrivals

the maximum number of arrivals to generate

qObjectClass

optional class template applied to each newly created instance

marking

optional action applied to each newly created instance (after the class)

name

the name of the station

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

The number of instances generated by this source.

Link copied to clipboard
open override val portName: String

The name of this port, unique within its StationNetwork.

Functions

Link copied to clipboard

Sets the receiver that processes generated instances.

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)

Receives a QObject as the network's ingress: performs the network entry bookkeeping and forwards the instance. If the instance carries its own sender (for example, a class-supplied route), that sender drives the first hop; otherwise the configured first receiver is used. Generated arrivals and externally injected instances both flow through here.

Link copied to clipboard

Stops generating further arrivals; the source still accepts externally injected instances via receive. Typically called from a scheduled action (e.g., a closing time).