Environment Context
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
the concentration type used by the simulation.
the position type used by the environment.
Functions
Enters the node deployment DSL.
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.
Registers a Layer associated with the given molecule in the current Environment.
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.
Configures (or extends) the environment network model by adding the provided model.
Registers a TerminationPredicate in the current Environment.