You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think there might be an issue with the SMF handling of transitions to self in hierarchical state machines.
A transition to self is when the run action of a state calls smf_set_state() with a target of itself. The exit and entry actions of the state should be called in that order.
The issue is when a child state triggers an event that causes a transition to self in a parent state. This should trigger a transition from the child state to the parent state and the following actions: child exit, parent exit, parent entry.
When ancestor run actions are executed, the context doesn't change, so a transition to self in a parent state looks like a transition from the child to the parent, not from parent to itself, and doesn't fire the exit action of the parent state. The result is: child exit, parent entry.
Is there any way to fix this behavior?
Example from the PSiCC2 book by Miro Samek:
When in state s11, receiving event A will propagate up to s1, which will initiate a transition to self. You should get s11 exit, s1 exit and s1 entry. (you should also then get an initial transition to s11, with s11 entry, but the SMF doesn't support initial transitions - yet)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I think there might be an issue with the SMF handling of transitions to self in hierarchical state machines.
A transition to self is when the run action of a state calls
smf_set_state()
with a target of itself. The exit and entry actions of the state should be called in that order.The issue is when a child state triggers an event that causes a transition to self in a parent state. This should trigger a transition from the child state to the parent state and the following actions: child exit, parent exit, parent entry.
When ancestor run actions are executed, the context doesn't change, so a transition to self in a parent state looks like a transition from the child to the parent, not from parent to itself, and doesn't fire the exit action of the parent state. The result is: child exit, parent entry.
Is there any way to fix this behavior?
Example from the PSiCC2 book by Miro Samek:

When in state s11, receiving event A will propagate up to s1, which will initiate a transition to self. You should get s11 exit, s1 exit and s1 entry. (you should also then get an initial transition to s11, with s11 entry, but the SMF doesn't support initial transitions - yet)
Beta Was this translation helpful? Give feedback.
All reactions