globalProgram

context(environment: Environment<T, P>)
open fun globalProgram(timeDistribution: TimeDistribution<T>, reaction: Reaction<T>, block: context(Reaction<T>) ActionableContext.() -> Unit = {})(source)

Registers a Reaction in the current Environment and optionally configures it.

The block, if provided, is executed with reaction as a context receiver and with ActionableContext as receiver, enabling the addition of actions and conditions.

The timeDistribution parameter is currently not used by this function. The expectation is that the provided reaction is already configured with the intended scheduling strategy (if any), or that the distribution is otherwise bound externally.

Parameters

timeDistribution

a time distribution associated with the global program; currently ignored.

reaction

the environment-hosted reaction to register.

block

an optional configuration block for actions and conditions.