Simulation Context
Top-level DSL scope for defining a simulation scenario.
A SimulationContext is responsible for collecting all scenario components that are needed to build a runnable simulation, including:
the Environment and its configuration (deployments, layers, global programs, network model, terminators);
exporters and output monitors;
the Launcher used to run the simulation;
scenario variables, exposed as delegated read-only properties.
Implementations typically distinguish between two random generators:
a scenario generator, used while constructing the scenario (e.g., during deployments or initialization);
a simulation generator, used for components that require randomness tied to simulation execution.
Type Parameters
the concentration type used by the simulation.
the position type used by the environment.
Functions
Creates a concentration value using the current Incarnation.
Sets the simulation environment and configures it through environmentConfiguration.
fun <T> SimulationContext<T, Euclidean2DPosition>.environment(block: context(Continuous2DEnvironment<T>) EnvironmentContext<T, Euclidean2DPosition>.() -> Unit)
Convenience overload that installs a default Continuous2DEnvironment and configures it via block.
Registers an Exporter and configures which it.unibo.alchemist.boundary.Extractor instances it should use.
Registers an OutputMonitor to observe the simulation execution.
Sets the random generator used during scenario construction.
Sets the scenario random generator to a MersenneTwister initialized with seed.
Sets the random generator used for simulation-related components.
Sets the simulation random generator to a MersenneTwister initialized with seed.
Declares a scenario Variable and returns a read-only property delegate that provides its value.