executeSimulation

fun executeSimulation(request: RequestData, model: Model, expIdentifier: String? = null): SimulationRun

Executes a simulation using the given request data and model. It updates the model's parameters based on the request data, runs the simulation, and resets the model's parameters to their original state after execution. This default implementation executes each replication of the request sequentially.

Return

the result of the simulation run encapsulated in a SimulationRun object. This contains the results from the executed simulation. If the simulation run resulted in errors, the simulation run's runErrorMsg property will not be empty (blank).

Parameters

request

the request data containing the model identifier, inputs, number of replications, and optional simulation run parameters. It specifies how the simulation should be executed.

model

the model to be used for the simulation. Includes the configuration and behavior required for the simulation execution.

expIdentifier

a string that is used to uniquely identify the experiment within the context of multiple executions for the same model. The name of the experiment will be: "

${request.modelIdentifier}_Exp_$

expIdentifier". If expIdentifier is null, then the time of the request is used to as expIdentifier. Depending on how users might store experimental results, this naming may be important, especially if a KSLDatabase is used to hold experimental results.