Python YASMIN (Yet Another State MachINe)
Loading...
Searching...
No Matches
yasmin_demos.yasmin_demo.FooState Class Reference
Inheritance diagram for yasmin_demos.yasmin_demo.FooState:
Collaboration diagram for yasmin_demos.yasmin_demo.FooState:

Public Member Functions

None __init__ (self)
 
str execute (self, Blackboard blackboard)
 
- Public Member Functions inherited from yasmin.state.State
str __call__ (self, Blackboard blackboard=None)
 
str __str__ (self)
 
None cancel_state (self)
 
bool is_canceled (self)
 
bool is_running (self)
 
Set[str] get_outcomes (self)
 

Public Attributes

int counter = 0
 

Additional Inherited Members

- Protected Attributes inherited from yasmin.state.State
Set _outcomes = set()
 A set of valid outcomes for this state.
 
bool _running = False
 A flag indicating whether the state is currently running.
 
bool _canceled = False
 A flag indicating whether the state has been canceled.
 

Detailed Description

Represents the Foo state in the state machine.

Attributes:
    counter (int): Counter to track the number of executions of this state.

Constructor & Destructor Documentation

◆ __init__()

None yasmin_demos.yasmin_demo.FooState.__init__ ( self)
Initializes the FooState instance, setting up the outcomes.

Outcomes:
    outcome1: Indicates the state should continue to the Bar state.
    outcome2: Indicates the state should finish execution and return.

Reimplemented from yasmin.state.State.

Member Function Documentation

◆ execute()

str yasmin_demos.yasmin_demo.FooState.execute ( self,
Blackboard blackboard )
Executes the logic for the Foo state.

Args:
    blackboard (Blackboard): The shared data structure for states.

Returns:
    str: The outcome of the execution, which can be "outcome1" or "outcome2".

Raises:
    Exception: May raise exceptions related to state execution.

Reimplemented from yasmin.state.State.

Member Data Documentation

◆ counter

int yasmin_demos.yasmin_demo.FooState.counter = 0

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