Table of Contents

Class RoutineImplementationBase

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

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

public abstract class RoutineImplementationBase
Inheritance
RoutineImplementationBase
Inherited Members

Constructors

RoutineImplementationBase(SimulatorRoutineRevision, Dictionary<string, SimulatorValueItem>, ILogger)

Creates a new simulation routine with the given routine revision

public RoutineImplementationBase(SimulatorRoutineRevision routineRevision, Dictionary<string, SimulatorValueItem> inputData, ILogger logger)

Parameters

routineRevision SimulatorRoutineRevision

Routine revision object

inputData Dictionary<string, SimulatorValueItem>

Data to use as input

logger ILogger

Logger instance

Methods

GetOutput(SimulatorRoutineRevisionOutput, Dictionary<string, string>, CancellationToken)

Gets a numeric simulation result that should be saved as a time series

public abstract SimulatorValueItem GetOutput(SimulatorRoutineRevisionOutput outputConfig, Dictionary<string, string> arguments, CancellationToken token)

Parameters

outputConfig SimulatorRoutineRevisionOutput

Output time series configuration

arguments Dictionary<string, string>

Extra arguments

token CancellationToken

Cancellation token

Returns

SimulatorValueItem

PerformSimulation(CancellationToken)

Perform the simulation routine and collect the results

public virtual Dictionary<string, SimulatorValueItem> PerformSimulation(CancellationToken token)

Parameters

token CancellationToken

Cancellation token

Returns

Dictionary<string, SimulatorValueItem>

Simulation results

Exceptions

SimulationException

When the simulation configuration is invalid

SimulationRoutineException

When the routine execution fails

OperationCanceledException

When the cancellation token is cancelled

RunCommand(Dictionary<string, string>, CancellationToken)

Invoke the given command on the simulator using the provided arguments.

public abstract void RunCommand(Dictionary<string, string> arguments, CancellationToken token)

Parameters

arguments Dictionary<string, string>

Arguments

token CancellationToken

Cancellation token

SetInput(SimulatorRoutineRevisionInput, SimulatorValueItem, Dictionary<string, string>, CancellationToken)

Implements a step that sets the value of an input to a simulation

public abstract void SetInput(SimulatorRoutineRevisionInput inputConfig, SimulatorValueItem input, Dictionary<string, string> arguments, CancellationToken token)

Parameters

inputConfig SimulatorRoutineRevisionInput

Input configuration

input SimulatorValueItem

Input value

arguments Dictionary<string, string>

Extra arguments

token CancellationToken

Cancellation token