betfsm.EventConcurrent

Bases: GeneratorWithList

maps events to execution of subtrees.

Similar to ConcurrentSequence but the children start not activated and all not active children are can be activated by an event.

A subtree matched with NO_EVENT starts also not activated, but is activated just after the first polling.

NO_EVENT is special and should not occur as incoming event. if NO_EVENT is not specified then SubtreeEvent keeps waiting (TICKING) until one of the event subtrees returns something else than SUCCEED.

The NO_EVENT subtree will not be repeated. the subtrees associated with events can be repeated but the same subtree is never executed concurrently multiple times. subtrees associated with multiple events are executed concurrently

See Also

events for a discussion on usage patterns.

stateDiagram-v2 direction TB classDef successClass fill:darkgreen,color:white classDef tickingClass fill:yellow,color:black classDef otherClass fill:darkorange,color:white classDef abortClass fill:darkred,color:white state "TICKING <br> if any TICK transition <br> is received" as TICKING state "OTHER <br>returns first other outome" as OTHER state "SUCCEED <br>if both transitions <br> are received" as SUCCEED state fork_state <<fork>> [*] --> fork_state fork_state --> NO_EVENT_subtree : NO_EVENT fork_state --> EVENT_1_subtree : EVENT_1 EVENT_1_subtree --> EVENT_1_succeeded : SUCCEED EVENT_1_succeeded --> EVENT_1_subtree : EVENT_1 state join_state <<fork>> NO_EVENT_subtree --> join_state : SUCCEED NO_EVENT_subtree --> OTHER : OTHER outcome EVENT_1_succeeded --> join_state EVENT_1_subtree --> OTHER : OTHER outcome join_state --> SUCCEED NO_EVENT_subtree --> TICKING : TICKING EVENT_1_subtree --> TICKING : TICKING class SUCCEED successClass class OTHER otherClass class TICKING tickingClass class TIMEOUT abortClass

add_state(state)

Not defined for an EventSequential