Deployments Context
DSL scope for instantiating and configuring nodes produced by a Deployment.
A Deployment enumerates a set of positions. For each produced position, an implementation of this context is expected to:
create a Node (either through a caller-provided factory or via an Incarnation);
enter a DeploymentContext to configure node contents, reactions, and properties;
(typically) insert the configured node into the current Environment.
This interface is based on Kotlin context receivers: the relevant RandomGenerator and Environment (and, in the overload that creates nodes via incarnation, also the Incarnation) must be available in the surrounding scope.
Functions
open fun deploy(deployment: Deployment<P>, nodeParameter: String? = null, block: context(RandomGenerator, Node<T>) DeploymentContext<T, P>.() -> Unit = {}): ERROR CLASS: Ambiguity: deploy, [it/unibo/alchemist/boundary/kotlindsl/DeploymentsContext.deploy, it/unibo/alchemist/boundary/kotlindsl/DeploymentsContext.deploy]
Deploys nodes according to the provided deployment, creating each node via the current incarnation and optionally configuring it through block.
abstract fun deploy(deployment: Deployment<P>, nodeFactory: (P) -> Node<T>, block: context(RandomGenerator, Node<T>) DeploymentContext<T, P>.() -> Unit)
Deploys nodes according to the provided deployment, creating each node through nodeFactory and configuring it through block.