withTimeDistribution

context(incarnation: Incarnation<T, P>, randomGenerator: RandomGenerator, environment: Environment<T, P>, node: Node<T>)
open fun withTimeDistribution(parameter: Any? = null, block: context(TimeDistribution<T>) TimeDistributionContext<T, P>.() -> Unit)

Enters a TimeDistributionContext using a time distribution derived from parameter.

If parameter is already a TimeDistribution, it is used as-is. Otherwise, a new distribution is created via Incarnation.createTimeDistribution, passing parameter through to the incarnation.

Parameters

parameter

either a concrete TimeDistribution instance, an incarnation-specific descriptor, or null.

block

the configuration block for defining reactions sharing the selected time distribution.