Table of Contents

Class SimulationRunnerBase<A, T, V>

Namespace
Cognite.Simulator.Utils
Assembly
Cognite.Simulator.Utils.dll

Represents the connector's simulation runner process. This base class can fetch simulation runs from CDF that are ready to run, validate them and find the time range to sample data where the process is in steady state.

public abstract class SimulationRunnerBase<A, T, V> where A : AutomationConfig where T : ModelStateBase where V : SimulatorRoutineRevision

Type Parameters

A
T

Type of model state objects

V

Type of simulation configuration objects

Inheritance
SimulationRunnerBase<A, T, V>
Derived
Inherited Members

Constructors

SimulationRunnerBase(ConnectorConfig, IList<SimulatorConfig>, CogniteDestination, IModelProvider<A, T>, IRoutineProvider<V>, ILogger)

Create a new instance of the runner with the provided parameters

public SimulationRunnerBase(ConnectorConfig connectorConfig, IList<SimulatorConfig> simulators, CogniteDestination cdf, IModelProvider<A, T> modelLibrary, IRoutineProvider<V> routineLibrary, ILogger logger)

Parameters

connectorConfig ConnectorConfig

Connector configuration

simulators IList<SimulatorConfig>

List of simulators

cdf CogniteDestination

CDF client

modelLibrary IModelProvider<A, T>

Model library

routineLibrary IRoutineProvider<V>

Configuration library

logger ILogger

Logger

Properties

ModelLibrary

Library containing the simulator model files

protected IModelProvider<A, T> ModelLibrary { get; }

Property Value

IModelProvider<A, T>

RoutineLibrary

Library containing the simulation configuration files

protected IRoutineProvider<V> RoutineLibrary { get; }

Property Value

IRoutineProvider<V>

Methods

Run(CancellationToken)

Start the loop for fetching and processing simulation events from CDF

public Task Run(CancellationToken token)

Parameters

token CancellationToken

Cancellation token

Returns

Task

RunRoutine(SimulationRunItem, DateTime, T, V, SamplingConfiguration, CancellationToken)

Run a simulation and saves the results back to CDF. Different simulators will implement different patterns of interaction when running simulations

protected abstract Task RunRoutine(SimulationRunItem runItem, DateTime startTime, T modelState, V configObj, SamplingConfiguration samplingConfiguration, CancellationToken token)

Parameters

runItem SimulationRunItem

Simulation run item

startTime DateTime

Simulation start time

modelState T

Model state object

configObj V

Configuration object

samplingConfiguration SamplingConfiguration

Selected simulation sampling samplingConfiguration

token CancellationToken

Cancellation token

Returns

Task