ProbabilisticRouter

Routes each arriving QObject to a receiver chosen at random by picker. The knownDestinations make the random choice introspectable for the network graph (the picker alone does not expose its elements). Supply a picker — such as an ksl.modeling.elements.REmpiricalList — over the same destinations.

Parameters

picker

the random element provider that selects the next receiver

knownDestinations

the receivers the picker chooses among, for graph introspection

Constructors

Link copied to clipboard
constructor(picker: RElementIfc<QObjectReceiverIfc>, knownDestinations: List<QObjectReceiverIfc>)

Functions

Link copied to clipboard
open override fun destinations(): List<QObjectReceiverIfc>

The possible destinations this router may select, for graph introspection.

Link copied to clipboard

Selects the receiver for the supplied qObject. Implementations must return a non-null receiver; supply a default/fallback to guarantee this.