Package it.unibo.alchemist.testsupport

Functions

Link copied to clipboard
fun <T> createEmptyEnvironment(vararg outputMonitors: OutputMonitor<T, Euclidean2DPosition> = emptyArray()): Continuous2DEnvironment<T>

Builds an empty environment, building a simulation Engine, and binding them. Optionally, some OutputMonitors can be provided.

Link copied to clipboard
fun <T, P : Position<P>> InitializedEnvironment<T, P>.createSimulation(): Engine<T, P>

Builds a new Engine, adding a GlobalExporter with the required it.unibo.alchemist.loader.export.Exporters.

Link copied to clipboard
fun <T, P : Position<P>> loadAlchemist(simulationFile: String, variables: Map<String, *> = emptyMap<String, Nothing>()): InitializedEnvironment<T, P>

Prepares an InitializedEnvironment given a simulationFile and, optionally, the variables' bindings.

Link copied to clipboard
fun <T, P : Position<P>, Vector<P>> loadYamlSimulation(resource: String, vars: Map<String, Double> = emptyMap()): EuclideanEnvironment<T, P>

Loads a simulation from a YAML file.

Link copied to clipboard
fun <T, P : Position<P>> Simulation<T, P>.runInCurrentThread(): Simulation<T, P>

Runs an existing Simulation in the current thread.

Link copied to clipboard
fun <T, P : Position<P>, Vector<P>> EuclideanEnvironment<T, P>.startSimulation(onceInitialized: (EuclideanEnvironment<T, P>) -> Unit = { }, atEachStep: (EuclideanEnvironment<T, P>, Reaction<T>?, Time, Long) -> Unit = { _, _, _, _ -> }, whenFinished: (EuclideanEnvironment<T, P>, Time, Long) -> Unit = { _, _, _ -> }, steps: Long = 10000): EuclideanEnvironment<T, P>

Run the simulation this environment owns.