ControlData Class

Control Data object, specifying a number of controls in the form of state machines and states with actions.

Definition

Namespace: DHI.Mike1D.ControlModule
Assembly: DHI.Mike1D.ControlModule (in DHI.Mike1D.ControlModule.dll) Version: 24.0.0.0 (11.1.1.1111)
C#
public class ControlData : AbstractDataAccess, 
	IModelStateReadWrite
Inheritance
Object    AbstractDataAccess    ControlData
Implements
IModelStateReadWrite

Constructors

ControlData Default constructor

Properties

ActionTargetDescriptions Dictionary with sensor descriptions as value and sensor ID as key
AdditionalData Additional data from the MIKE 1D data object. Set during initialize.
BaseFilePath Base file path is use to find supporting files when reading control structures For M11 setups, this points to the directory of the .nwk file
BuildInVariables List of build-in predefined variables. Contains variables like dt.

If a sensor or another variable is defined with the same name, variables in this list is ignored.

CommonData Common data, e.g. data to be shared between model instances.
Connection Holder of read/write information
(Inherited from AbstractDataAccess)
ControlStateMachines List of controls handled by the control module.
ControlUpdaters List of IControlFunctionTime objects, which need an explicit call to Update(DateTime, DateTime) before it can evaluate control/function/etc.

Used during simulation. Used e.g. by control functions (functions in expressions) that depend on time (added automatically during Prepare(DateTime, IDiagnostics)).

CustomTypes List of custom types stored in the data object and that must be serialized.

A custom type is e.g. a user implemented structure or catchment model. In order to store information on the custom type in the .m1dx file, the system needs to know which custom types are being used, and they must be added to this list.


(Inherited from AbstractDataAccess)
ExpressionFactory Expression factory that must be used when creating expressions for this control data object.
ExtensionData Holds data from an extended DataContract
(Inherited from AbstractDataAccess)
NumberOfIterations Number of iterations when applying the control.

Default value is 1. Only increase if there are controls depending on other controls.

In case some controls depends on other controls, it can be necessary to evaluate the controls twice, such having the second control updated in the second iteration, after the first control has updated in first iteration.

SensorDescriptions Sensor descriptions, indexed by their id.
Sensors List of sensors.

Used during simulation. All sensors in SensorDescriptions are automatically created during Initialize(Diagnostics).

Sensors that are required but not part of SensorDescriptions must be added explicitly.

TableInfos Information on time series. Each time series info has their own unique ID.
TimeSeriesInfos Information on time series. Each time series info has their own unique ID.
TsBuffer A buffer containing all timeseries, so they can be reused as much as possible.
UserFunctionFactories Factory for creating user functions. All user defined functions must be added to the set of UserFunctions or be returned by a UserFunctionFactories.
UserFunctions User defined functions in the expression. All user defined functions must be added to the set of UserFunctions or be returned by a UserFunctionFactories.
Variables List of user defined variables.

User defined variables are variables that are evaluated in every Update(DateTime, DateTime) and can be used in other expressions.

The variables are evaluated in-order, if a variable "A" is used in the expression of another variable "B", then "A" must be defined before "B" in this list.

Methods

CreateSensor(String, SensorLocationType, IQuantity) Create sensor
CreateSensorT(String, SensorLocationType, IQuantity) Create sensor, type specific version
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
FinalizeTimeStep Update control data and all its controls
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetOrCreateSensor(String, SensorLocationType, IQuantity) Get or create sensor.

Sensors defined in SensorDescriptions will automatically be created. This is relevant for sensors that is not connected to anything by default, but needs user interaction to get connected.

GetOrCreateSensorT(String, SensorLocationType, IQuantity) Get or create sensor.

Sensors defined in SensorDescriptions will automatically be created. This is relevant for sensors that is not connected to anything by default, but needs user interaction to get connected.

GetTypeGets the Type of the current instance.
(Inherited from Object)
Initialize Initialize control module.

It creates all sensors defined in SensorDescriptions and initializes all ControlStateMachines.

MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Prepare Prepare control data.
PrepareForTimestep Prepare control data for time step.
ReadState Read state and apply to module. Returns true if state was successfully read.
ReleaseLicense Internal method
ReorderVariables Method that tries to reorder the variables according to dependencies. if a circular dependency is spotted, the diagnostics reports the error. Clarification: The method is public as it is unit tested.
Reset Reset inner state of sensors, control state machines and actions
ToStringReturns a string that represents the current object.
(Inherited from Object)
Update Update control data and all its controls
Validate Validate control data, except time series sensors
Validate(DateTime, DateTime) Validate all of control data, including time series sensors
WriteState Write current state of module

Events

PreUpdateEvent Event that is triggered initially at any call to Update(DateTime, DateTime)

Fields

_connection Protected holder of read/write info
(Inherited from AbstractDataAccess)

See Also