ControlStateMachine Class

State machine used for applying different actions to the setup.

The Control State Machine implements a finite-state machine (FSM). It can only be in one of the States defined, being the CurrentState. Each State has its own transition table, TransitionTable, defining conditions for changing to a new state, and an Action is associated to every state.

Actions can be reused by several states, but actions cannot (should not) be reused between by several ControlStateMachine's.

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 ControlStateMachine
Inheritance
Object    ControlStateMachine

Constructors

Properties

Actions Actions in the state machine.

Actions may be reused, so number of actions may be less than number of states.

Do not modify this list.

CurrentState The current state of the machine.
Id The Id of the machine.
IsActive Shows if the control state machine is active.
States States in the state machine.

Do not modify this list. Use CreateState(IAction) to add to list.

TransitionTables State transition tables can be reused. This is storing all state transition tables in one list, and using the _transitionTableIndex as and index into this list.

Methods

Activate Activate the control state machine
CreateSimpleControl Create a simple control that at every time step applies the specified action.
CreateState Create a new state, add it to the state machine and return it.
Deactivate Deactivate the control state machine
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)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetOrCreateAction Get action with id, or create it if it does not exist
GetTypeGets the Type of the current instance.
(Inherited from Object)
Initialize Initialize state machine
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ReplaceAction Replace one action with a new action, updating the Actions list and also the action in all states.
Reset Reset the state machine and all the states.
SetGlobalStateTransitionTable Set the same transition table to all states
SetStateTransitionTable Set the same transition table to all states
ToStringReturns a string that represents the current object.
(Inherited from Object)
Update Update control state machine for the given time interval
UpdateStateAction Update action of a state.

Both the state and the action must be part of this control, i.e. in the list of States and Actions respectively.

Validate Validate state machine and all states.

See Also