MatchStation

class MatchStation(parent: ModelElement, val numInputs: Int, keyExtractor: (ModelElement.QObject) -> Any? = null, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, name: String? = null) : ModelElement, RoutingOutletsIfc, MatchStationCIfc(source)

Synchronizes (assembles) instances arriving on several inputs: when one instance is available on every input — optionally with the same matching key — the station removes one from each, combines them into a single instance (carrying the members as its attached object), and sends it onward.

With no keyExtractor, any one instance from each input is matched (an unkeyed AND-join). With a keyExtractor, only instances sharing a key value across all inputs are matched. Wire upstream nodes to the input endpoints.

Note: assembly reduces population — N members become one combined instance — so the owning network's number-in-system will not balance for assembly models; use the station's own statistics.

Parameters

parent

the model element serving as this station's parent

numInputs

the number of inputs to synchronize (>= 2)

keyExtractor

optional key for keyed matching; null matches one from each input

nextReceiver

where combined instances are sent

name

the name of the station

Constructors

Link copied to clipboard
constructor(parent: ModelElement, numInputs: Int, keyExtractor: (ModelElement.QObject) -> Any? = null, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, 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
Link copied to clipboard
open override val numMatched: CounterCIfc

The number of matched sets formed (assemblies emitted).

Link copied to clipboard
open override val numWaiting: TWResponseCIfc

Time-weighted number of instances waiting to be matched across all inputs.

Functions

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

Returns the receiver for input index.

Link copied to clipboard

Sets the receiver of combined 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).