DeploymentContext

interface DeploymentContext<T, P : Position<P>>

DSL scope for configuring a single node during a deployment.

A DeploymentContext is typically entered once per deployed position, and provides:

  • the target position being deployed;

  • utilities to create and attach reactions (optionally configuring actions/conditions);

  • utilities to initialize node contents and attach NodeProperty instances.

Most operations rely on Kotlin context receivers, so the relevant Incarnation, Environment, RandomGenerator, and Node instances are expected to be available in the surrounding scope.

Type Parameters

T

the concentration type used by the simulation.

P

the position type used by the environment.

Properties

Link copied to clipboard
abstract val position: P

The position where the node is being deployed.

Functions

Link copied to clipboard
context(_: Incarnation<T, P>, _: Node<T>)
open fun contents(block: context(Incarnation<T, P>) ContentContext.() -> Unit)

Configures the initial contents of the current node.

Link copied to clipboard
context(node: Node<T>)
open fun nodeProperty(property: NodeProperty<T>)

Attaches a NodeProperty to the current node.

Link copied to clipboard
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.

Link copied to clipboard
Link copied to clipboard
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.