program

context(incarnation: Incarnation<T, P>, randomGenerator: RandomGenerator, environment: Environment<T, P>, node: Node<T>)
open fun program(program: String? = null, timeDistribution: Any? = null, block: context(Reaction<T>) ActionableContext.() -> Unit = { })

Convenience utility to create and register a reaction on the current node.

A time distribution is obtained through withTimeDistribution, using timeDistribution as parameter. The reaction is then created via Incarnation.createReaction, using program as an incarnation-specific descriptor (or null to delegate the choice to the incarnation), and finally registered on the node.

The optional block can be used to attach actions and conditions through ActionableContext.

Parameters

program

an incarnation-specific reaction/program descriptor, possibly null.

timeDistribution
  either a concrete [TimeDistribution] instance, an incarnation-specific descriptor, or `null`.
block

an optional configuration block for actions and conditions.