Class SimulationRunnerBase<A, T, V>
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
ConnectorConfigConnector configuration
simulators
IList<SimulatorConfig>List of simulators
cdf
CogniteDestinationCDF client
modelLibrary
IModelProvider<A, T>Model library
routineLibrary
IRoutineProvider<V>Configuration library
logger
ILoggerLogger
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
Methods
Run(CancellationToken)
Start the loop for fetching and processing simulation events from CDF
public Task Run(CancellationToken token)
Parameters
token
CancellationTokenCancellation token
Returns
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
SimulationRunItemSimulation run item
startTime
DateTimeSimulation start time
modelState
TModel state object
configObj
VConfiguration object
samplingConfiguration
SamplingConfigurationSelected simulation sampling samplingConfiguration
token
CancellationTokenCancellation token