Click or drag to resize

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.

Inheritance Hierarchy
SystemObject
  DHI.Mike1D.ControlModuleControlStateMachine

Namespace:  DHI.Mike1D.ControlModule
Assembly:  DHI.Mike1D.ControlModule (in DHI.Mike1D.ControlModule.dll) Version: 19.0.0.0 (11.1.1.1111)
Syntax
public class ControlStateMachine

The ControlStateMachine type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyActions
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.

Public propertyCurrentState
The current state of the machine.
Public propertyId
The Id of the machine.
Public propertyIsActive
Shows if the control state machine is active.
Public propertyStates
States in the state machine.

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

Top
Methods
  NameDescription
Public methodActivate
Activate the control state machine
Public methodStatic memberCreateSimpleControl
Create a simple control that at every time step applies the specified action.
Public methodCreateState
Create a new state, add it to the state machine and return it.
Public methodDeactivate
Deactivate the control state machine
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetOrCreateAction
Get action with id, or create it if it does not exist
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInitialize
Initialize state machine
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodReplaceAction
Replace one action with a new action, updating the Actions list and also the action in all states.
Public methodReset
Reset the state machine and all the states.
Public methodSetGlobalStateTransitionTable
Set the same transition table to all states
Public methodSetStateTransitionTable
Set the same transition table to all states
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdate
Update control state machine for the given time interval
Public methodUpdateStateAction
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.

Public methodValidate
Validate state machine and all states.
Top
See Also