Sage Modeling and Simulation Library

StateMachine Members

The StateMachine type exposes the following members.

Constructors


  Name Description
Public method StateMachine(array<Boolean,2>[,](,)[,][,], array<Enum>[]()[][], Enum)
Creates a state machine that does not reference a Model. Many of the event delegates send a model reference with the notification. If the recipients all either (a) don't need this reference, (b) have it from elsewhere, or (c) the entity creating this state machine will set the Model later, then this constructor may be used.
Public method StateMachine(IModel, array<Boolean,2>[,](,)[,][,], array<Enum>[]()[][], Enum)
Creates a state machine that references a Model. Many of the event delegates send a model reference with the notification.

Methods


  Name Description
Public method _TestGetStateNumber
Test method that exposes a state machine's state's number.
Public method Detach
Public method DoTransition(Enum)
Commands the state machine to attempt transition to the indicated state. Returns a list of ITransitionFailureReasons. If this list is empty, the transition was successful.
Public method DoTransition(Enum, Object)
Commands the state machine to attempt transition to the indicated state. Returns a list of ITransitionFailureReasons. If this list is empty, the transition was successful.
Public method Equals(System.Object)
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected method Finalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public method ForceOverrideState
Forces the state machine into the new state. No transitions are done, no handlers are called - It's just POOF, new state. Use this with extreme caution!
Public method GetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public method GetStateEquivalentTo
Gets the application defined Enum (state) that equates to the provided generic state.
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method InboundTransitionHandler
Provides a reference to the transition handler that helps govern all transitions INTO a specified state.
Public method IsStateQuiescent
Determines whether the specified state is quiescent - i.e. has no automatic follow-on state.
Protected method MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public method OutboundTransitionHandler
Provides a reference to the transition handler that helps govern all transitions OUT OF a specified state.
Public method RunTransitionSequence
Attempts to run the sequence of transitions. If any fail, the call returns in the state where the failure occurred, and the reason list contains whatever reasons were given for the failure. This is to be used if the progression is simple. If checks and responses need to be done, the developer should build a more step-by-step sequencing mechanism.
Public method SetGenericStateEquivalents
Sets the model-specific enums (states) that equate to each of the StateMachine.GenericState values.
Public method SetModel
Allows the caller to set the model that this State Machine references.
Public method SetStateMethod
Sets the method that will be called when the state machine enters a given state.
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Public method TransitionHandler
Provides a reference to the transition handler that helps govern the transition between two specified states.
Public method UniversalTransitionHandler
Provides a reference to the transition handler that helps govern all transitions.

Properties


  Name Description
Public property IsTransitioning
True if the state machine is in the process of performing a transition.
Public property NextState
Provides the identity of the next state that the State Machine will enter.
Public property State
The current state of the state machine.
Public property StructureLocked

Events


  Name Description
Public event TransitionCompletedSuccessfully
This event fires when a transition completes successfully, and reaches the intended new state.