|
Code_Saturne
CFD tool
|


Public Member Functions | |
| def | __init__ (self, start_state=None, transitions=[]) |
| def | setStartState (self, state) |
| def | addTransition (self, from_state, to_state, condition, callback) |
| def | makeTransition (self, input) |
Data Fields | |
| transitions | |
| current_state | |
| current_input | |
| current_transition | |
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
| def __init__ | ( | self, | |
start_state = None, |
|||
transitions = [] |
|||
| ) |
| 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 | |||
| ) |
| current_input |
| current_state |
| current_transition |
| transitions |
1.8.13