Home | Trees | Indices | Help |
|
---|
|
object --+ | FSM --+ | ObjFSM
A subclass of FSM where input_symbol may be any kind of object, even an unhashable one. For each input_symbol to process, the machine will try a sequence of functions; the first to return True determines (action, next_state).
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
|||
Inherited from |
|
This adds a transition that associates: (input_symbol, current_state) --> (action, next_state) The action may be set to None in which case the process() method will ignore the action and only set the next_state. The next_state may be set to None in which case the current state will be unchanged. You can also set transitions for a list of symbols by using add_transition_list().
|
This returns (action, next state) given an input_symbol and state. This does not modify the FSM state, so calling this method has no side effects. Normally you do not call this method directly. It is called by process(). The sequence of steps to check for a defined transition goes from the most specific to the least specific. 1. Check state_transitions[] that match exactly the tuple, (input_symbol, state) 2. Check state_transitions_any[] that match (state) In other words, match a specific state and ANY input_symbol. 3. Check if the default_transition is defined. This catches any input_symbol and any state. This is a handler for errors, undefined states, or defaults. 4. No transition was defined. If we get here then raise an exception.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Dec 2 23:44:22 2012 | http://epydoc.sourceforge.net |