BlockingStation

class BlockingStation(parent: ModelElement, val bufferCapacity: Int, activityTime: RVariableIfc, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, name: String? = null) : ModelElement, BlockableReceiverIfc, RoutingOutletsIfc, BlockingStationCIfc(source)

A single-server station with a finite buffer that uses block-after-service semantics: when the server completes an instance but the downstream receiver cannot accept it, the server is blocked — it holds the finished instance and does not start the next one until the downstream frees a slot. A chain of blocking stations models a production line with limited buffers and back-pressure.

The finite buffer (bufferCapacity, the maximum number waiting + in service + blocked) is enforced via canReceive for blocking upstreams; a non-blocking upstream (such as a source) is expected not to exceed it.

Parameters

parent

the model element serving as this station's parent

bufferCapacity

the maximum number of instances the station may hold (>= 1)

activityTime

the service-time distribution

nextReceiver

where processed instances are pushed

name

the name of the station

Constructors

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

Properties

Link copied to clipboard

Time-weighted 0/1 indicator that the server is blocked (finished but cannot push downstream).

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 numInStation: TWResponseCIfc

Time-weighted number of instances in the station (waiting, in service, or blocked).

Link copied to clipboard
open override val numProcessed: CounterCIfc

The number of instances processed (pushed downstream).

Link copied to clipboard
open override val stationTime: ResponseCIfc

Time in the station per processed instance (includes any blocking delay).

Link copied to clipboard

The waiting queue (read-only).

Functions

Link copied to clipboard
open override fun attachSpaceAvailableListener(listener: () -> Unit)

Registers a listener invoked when a slot frees (so a blocked upstream can push).

Link copied to clipboard
open override fun canReceive(): Boolean

True if the receiver currently has room for another instance.

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 downstream receiver, registering for its space-available events if blockable.

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)