betfsm.ConcurrentFallback
Bases: GeneratorWithList
Implements a behaviortree-like Fallback node
- success is any other outcome,
- failure is CANCEL outcome
There is a method add_state to add underlying nodes to ConcurrentFallback, these are executed
in order.
In contrast to Fallback this node runs concurrently. At each call, ConcurrentFallback runs through
the list of underlying active states and:
- If an underlying state returns CANCEL, it becomes inactive. If all states have become inactive, the ConcurrentFallback returns CANCEL
- If an underlying active state returns another outcome besides TICKING and CANCEL, the Sequence returns the outcome of the first such state (a "success" ) and cancels the other running states.
- If any of the states has returned TICKING, the sequence returns TICKING
In summary, it is similar to Fallback, but it calls all underlying states together (in order), and not one-by-one. ConcurrentFallback waits until all underlying states have finished ( a "join")
__init__(name, children=[])
| Parameters: |
|
|---|
co_execute(blackboard)
executes the underlying states in the fallback node, as much as possible concurrently. all outcomes except for CANCEL and TICKING indicate success. Fails with CANCEL when all underlying states have returned CANCEL.
| Parameters: |
|
|---|