NHPPSource

A non-homogeneous Poisson process source: generates arriving QObject instances at a time-varying rate driven by a PiecewiseRateFunction, then injects them into the StationNetwork. The companion to SourceStation for non-stationary arrivals.

Internally wraps NHPPPiecewiseRateFunctionEventGenerator. The rate function can be piecewise-constant or piecewise-linear; the most common case (piecewise-constant rates over fixed-duration intervals) is offered via StationNetwork.nhppSource which takes parallel durations and rates arrays. Instances are created by the source 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.

Typically created via StationNetwork.nhppSource.

Parameters

network

the network this source feeds

rateFunction

the piecewise rate function

firstReceiver

the receiver that processes generated instances

streamNum

the stream number for the underlying NHPP

maxArrivals

the maximum number of arrivals to generate

marking

optional action applied to each newly created instance

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 door-closing time) — pairs with the conditional-routing pattern where in-flight instances also short-circuit to an exit when a model flag flips.