BatchStation

class BatchStation(parent: ModelElement, val batchSize: Int, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, name: String? = null) : ModelElement, QObjectReceiverIfc, RoutingOutletsIfc, BatchStationCIfc(source)

Accumulates arriving QObject instances until batchSize have been collected, then forms a single batch QObject (carrying the members as its attached object) and sends it onward. A SeparateStation is the inverse, recovering the members.

The batch wrapper is a new instance and is not counted in the owning network's number-in-system; the original members carry that accounting, so batching then separating is population-neutral. Members left accumulating at the end of a replication are simply not batched.

Parameters

parent

the model element serving as this station's parent

batchSize

the number of instances per batch (>= 1)

nextReceiver

where formed batches are sent

name

the name of the station

Constructors

Link copied to clipboard
constructor(parent: ModelElement, batchSize: Int, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, name: String? = null)

Properties

Link copied to clipboard
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 numAccumulating: TWResponseCIfc

Time-weighted number of instances currently accumulating toward a batch.

Link copied to clipboard
open override val numBatchesFormed: CounterCIfc

The number of batches formed.

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

Sets the receiver of formed batches.

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)