stp.utils.fsm

Module Contents

Classes

Event

dict() -> new empty dictionary

StateMachine

Attributes

State

TransitionFunction

TransitionTable

StateMethod

OnEnterMethod

OnExitMethod

stp.utils.fsm.State
stp.utils.fsm.TransitionFunction
class stp.utils.fsm.Event

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

condition :TransitionFunction
name :str
stp.utils.fsm.TransitionTable
stp.utils.fsm.StateMethod
stp.utils.fsm.OnEnterMethod
stp.utils.fsm.OnExitMethod
class stp.utils.fsm.StateMachine(start_state: State)
property start_state(self) State
restart(self) None
tick(self) None
add_transition(self, from_state: State, to_state: State, condition: Union[bool, TransitionFunction], event_name: str) None
transition(self, new_state: State) None
property state(self) Optional[State]