Table of Contents

Namespace Cognite.Simulator.Utils

Classes

BaseConfig

Base configuration object for simulators.

CommonUtils

Common utility methods. May be useful when developing simulator connectors

ConnectorBase<T>

Base class for simulator connectors. Implements heartbeat reporting. The connector information is stored in the simulator integration resource in CDF.

ConnectorConfig

Represents the configuration for connectors. This defines basic connector properties such as name and intervals for status report and for fetching events

ConnectorException

Represents errors related to the connector operation

DefaultConfig<TAutomationConfig>
DefaultConnectorConfig
DefaultConnector<TAutomationConfig, TModelState, TModelStateBasePoco>
DefaultModelFileStatePoco
DefaultModelFilestate
DefaultModelLibrary<TAutomationConfig, TModelStateBase, TModelStateBasePoco>

Default implementation of a model library for a simulator

DefaultRoutineLibrary<TAutomationConfig>

A default instance of the routine library.

DefaultSimulationRunner<TAutomationConfig, TModelStateBase, TModelStateBasePoco>
DefaultSimulationScheduler<TAutomationConfig>
ExtractionPipeline

This class can be used to link the connector to a extraction pipeline in CDF

ExtractionPipelineExtensions

Extension methods for extraction pipelines

FileState

Represents the state of a simulator file

FileStatePoco

Data object that contains the state properties to be persisted by the state store. These properties are restored to the state on initialization

FileStorageClient

HTTP client that can be used to download and upload files from/to a server

LicenseCheckConfig

Configuration for license checks

LoggerConfig

Logging configuration object

LoggingExtensions

Extension utilities for logging

ModelLibraryBase<A, T, U, V>

Represents a local model file library. It fetches simulator model files from CDF, save a local copy and process the model (extract information). This library only keeps the latest version of a given model file

ModelLibraryConfig

Represents the configuration for a model library. Used to configure ModelLibraryBase<A, T, U, V> and derived classes

ModelParsingInfo

Represents the information produced during model parsing. That is, when a model is downloaded, the connector will try to open the model with the simulator, extract information from the model and update that information in CDF (if necessary). The parsing info should capture information about this process (error, status, etc)

ModelStateBase

This base class represents the state of a model file TODO: See if we can remove FileState completely and move all the variables into this class Jira: https://cognitedata.atlassian.net/browse/POFSP-558

ModelStateBasePoco

Data object that contains the model state properties to be persisted by the state store. These properties are restored to the state on initialization

NewConfigDetected

Exception used to restart connector

PipelineNotificationConfig

Pipeline notification configuration. This states how many errors can happen in a time frame before notifying the extraction pipeline. Usually connectors can recover from intermittent errors, and this policy can reduce the number of times alerts are generated due to pipeline errors

RemoteLogConfig

Configuration for remote logging (logs are stored in CDF)

RoutineImplementationBase

Base implementation for simulation routines. This class parses routines of type CogniteSdk.Alpha.SimulatorRoutineRevision and calls the abstract methods that executes each step type.

RoutineLibraryBase<V>

Represents a local routine revision library. It fetches all routine revisions from CDF and stores them in memory.

RoutineLibraryConfig

Represents configuration for a local routine library. Used to configure RoutineLibraryBase<V>

RoutineRunnerBase<A, T, V>

Simulation runner for simulation routine revision of type CogniteSdk.Alpha.SimulatorRoutineRevision

ScheduledJob<V>

Represents a scheduled job for simulation.

ScopedRemoteApiSink

Represents a sink for emitting log events to a remote API.

SimulationException

Represents errors related to running simulations

SimulationRoutineException

Represents a simulation routine error

SimulationRunItem

Wrapper class for CogniteSdk.Alpha.SimulationRun entity. Contains the simulation run configuration as a dictionary of key-value pairs

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.

SimulationSchedulerBase<V>

This class implements a basic simulation scheduler. It runs a loop on a configurable interval. Each iteration, it checks the schedules for all configurations and determine if the simulation should be triggered. It is assumed that the simulator can only run one simulation at a time, and therefore there is no need to schedule parallel simulation runs. Alternatives to this implementation include libraries such as Quartz, but the added complexity of a full fledged scheduling library in not necessary at this point. Also, at some point scheduling the creation of CDF simulation runs should be done by a cloud service, instead of doing it in the connector.

SimulationUtils

Collects utility methods used by the connector

SimulatorConfig

Represents a simulator configuration, holding the simulator name and dataset id in CDF. Ideally, all the data related to the simulator should be in this dataset

SimulatorLoggingUtils

Utility class for configuring simulator loggers. The logging framework used is Serilog. Loggers are created according to a LoggerConfig configuration object. Log messages contain UTC timestamps.

StateUtils

Utility methods for managing state

TimeManager

Default implementation of the time manager.

Interfaces

IModelProvider<A, T>

Interface for libraries that can provide model information

IRoutineProvider<V>

Interface for library that can provide routine configuration information

ISimulatorClient<T, V>

Interface to be implemented by simulator integration clients that can execute simulation configuration of the type V

ITimeManager

A wrapper around the .NET Task.Delay method. This is useful for testing purposes, where the delay can be faked.

Enums

ConnectorStatus

Connector status

LicenseStatus

License status