Code_Saturne
CFD tool
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Data Fields
FSM Class Reference
Inheritance diagram for FSM:
Inheritance graph
Collaboration diagram for FSM:
Collaboration graph

Public Member Functions

def __init__
 
def setStartState
 
def addTransition
 
def makeTransition
 

Data Fields

 transitions
 
 current_state
 
 current_input
 
 current_transition
 

Detailed Description

Implements a finite state machine.

Transitions are given as 4-tuples, consisting of an origin state, a target
state, a condition for the transition (given as a reference to a function
which gets called with a given piece of input) and a pointer to a function
to be called upon the execution of the given transition. 
@var transitions holds the transitions
@var current_state holds the current state
@var current_input holds the current input
@var current_transition hold the currently active transition

Constructor & Destructor Documentation

def __init__ (   self,
  start_state = None,
  transitions = [] 
)

Member Function Documentation

def addTransition (   self,
  from_state,
  to_state,
  condition,
  callback 
)
def makeTransition (   self,
  input 
)
Makes a transition based on the given input.

@param  input   input to parse by the FSM
def setStartState (   self,
  state 
)

Field Documentation

current_input
current_state
current_transition
transitions

The documentation for this class was generated from the following file: