simulation

fun <T, P : Position<P>, I : Incarnation<T, P>> simulation(incarnation: I, block: context(I) SimulationContext<T, P>.() -> Unit): Loader

Creates an Alchemist Loader using the Kotlin DSL.

The returned Loader encapsulates the scenario definition provided in block and can later be queried (optionally with variable bindings) to obtain a fully configured simulation instance.

The block is executed with the provided incarnation available as a context receiver, and with a SimulationContext receiver, enabling the definition of the environment, deployments, exporters/monitors, launcher, and scenario variables.

Return

a Loader that can build the simulation described by block.

Parameters

incarnation

the incarnation used to create domain-specific objects (molecules, nodes, reactions, etc.).

block

the DSL block defining the scenario.

Type Parameters

T

the concentration type used by the simulation.

P

the position type used by the environment.

I

the specific incarnation type.