EnvironmentContext

fun interface EnvironmentContext<T, P : Position<P>>

DSL scope for configuring an Environment within a simulation scenario.

This context groups environment-level configuration concerns, including:

  • deploying nodes through a DeploymentsContext;

  • registering global reactions;

  • registering layers (molecule → Layer mappings);

  • configuring the environment network model (LinkingRule);

  • registering termination predicates.

Most operations rely on Kotlin context receivers: the relevant Environment (and, when applicable, the Incarnation and/or RandomGenerator) must be available in the surrounding scope.

Type Parameters

T

the concentration type used by the simulation.

P

the position type used by the environment.

Functions

Link copied to clipboard
abstract fun deployments(deploymentsConfiguration: context(RandomGenerator) DeploymentsContext<T, P>.() -> Unit)

Enters the node deployment DSL.

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

Link copied to clipboard
context(environment: Environment<T, P>)
open fun layer(molecule: Molecule, layer: Layer<T, P>)

Registers a Layer associated with the given molecule in the current Environment.

context(incarnation: Incarnation<T, P>, environment: Environment<T, P>)
open fun layer(molecule: String? = null, layer: Layer<T, P>): ERROR CLASS: Ambiguity: layer, [it/unibo/alchemist/boundary/kotlindsl/EnvironmentContext.layer, it/unibo/alchemist/boundary/kotlindsl/EnvironmentContext.layer]

Registers a Layer associated with a molecule identified by molecule in the current Environment.

Link copied to clipboard
context(environment: Environment<T, P>)
open fun networkModel(model: LinkingRule<T, P>)

Configures (or extends) the environment network model by adding the provided model.

Link copied to clipboard
context(environment: Environment<T, P>)
open fun terminator(terminator: TerminationPredicate<T, P>)

Registers a TerminationPredicate in the current Environment.