deploy

context(randomGenerator: RandomGenerator)
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.

The block is invoked once per deployed position, after the node has been created and while a suitable DSL scope is active. Within block, a DeploymentContext is provided as receiver, and the current RandomGenerator and the created Node are available as context receivers.

Parameters

deployment

the deployment strategy producing the positions where nodes should be created.

nodeFactory

a factory used to create a node for each deployed position.

block

an optional per-node configuration block.


context(incarnation: Incarnation<T, P>, randomGenerator: RandomGenerator, environment: Environment<T, P>)
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.

Node creation is delegated to Incarnation.createNode, using the current randomGenerator and environment. The optional nodeParameter is forwarded to the incarnation and its meaning depends on the concrete incarnation.

Parameters

deployment

the deployment strategy producing the positions where nodes should be created.

nodeParameter

an optional incarnation-specific node descriptor, possibly null.

block

an optional per-node configuration block.