Module Index

Constructor

Class: StateMachine

The StateMachine class is used to manage a pool of various states. A StateMachine instance may have a current state.

Constructor

__init__ (self, *args, **kw)

Constructor. Initialize the base Type class as well as the StateMachine attributes.

Methods

add_state (self, state)

Add a new state to the states available to this machine. This method will publish a EventStateMachineAddState event.

add_transition (self, target, predicate)

Add a new transition to the state transitions available to this machine. This method will publish a EventStateMachineAddTransition event.

change_state (self, state)

Change the current state of this machine to the specified state. This method will publish a EventStateMachineChangeState event.

remove_state (self, state)

Remove the specified state from the states available to this machine. This method will publish a EventStateMachineRemoveState event.

transition (self)

Execute all state transitions available to this machine, possibly changing the current state. This method will publish a EventStateMachineTransition event.