globalProgram

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

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

The block, if provided, is executed with globalReaction 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 globalReaction 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.

globalReaction

the global reaction to register.

block

an optional configuration block for actions and conditions.