layer

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.

Layers are used to provide environment-wide values (e.g., fields or maps) that can be queried by nodes or reactions via the associated molecule.

Parameters

molecule

the molecule acting as key for the layer.

layer

the layer instance to register.


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.

The molecule is created via Incarnation.createMolecule. The meaning of a null molecule name, if any, depends on the concrete incarnation.

Parameters

molecule

the molecule name, possibly null (incarnation-dependent semantics).

layer

the layer instance to register.