SimulationService

open class SimulationService @JvmOverloads constructor(val modelProvider: ModelProviderIfc, val simulationRunCache: SimulationRunCacheIfc? = null, var useCachedSimulationRuns: Boolean = false) : SimulationServiceIfc(source)

This simulation service will execute evaluation requests on models and collect the desired responses. This service runs the model's replications locally and sequentially in the same execution thread as the requests.

Parameters

modelProvider

provides the models that are registered with this provider based on their model identifiers

simulationRunCache

if supplied the cache will be used to store executed simulation runs.

useCachedSimulationRuns

Indicates whether the service should use cached simulation runs when responding to requests. The default is false. If the simulation runs are not cached, this option has no effect.

Constructors

Link copied to clipboard
constructor(modelProvider: ModelProviderIfc, simulationRunCache: SimulationRunCacheIfc? = null, useCachedSimulationRuns: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun experimentalParameters(modelIdentifier: String): ExperimentRunParameters

Retrieves the experimental run parameters for the model identified by the given identifier. This method extracts detailed configurations and settings required to execute the experiment.

Link copied to clipboard
open override fun inputNames(modelIdentifier: String): List<String>

Retrieves the list of input names associated with the specified model.

Link copied to clipboard
open override fun isModelProvided(modelIdentifier: String): Boolean
Link copied to clipboard
open override fun providedModels(): List<String>

Retrieves a list of model identifiers provided by the service. These identifiers represent the models available for simulation runs or other operations.

Link copied to clipboard
open override fun responseNames(modelIdentifier: String): List<String>

Retrieves a list of response names associated with the specified model.

Link copied to clipboard
open override fun runSimulation(request: RequestData): Result<SimulationRun>

Executes a simulation run based on the given request data. This method retrieves simulation results from the cache if available, or executes the simulation using the provided model. If the simulation completes successfully, the result is cached for future requests. If the simulation results in an error, an exception is returned with the error details.