Closed fkromer closed 4 months ago
Interesting! I didn't know about the existence of HSMs.
What are the conditions to enter the inner state ?
@fkromer
HSMs or NFSMs (Nested Finite State Machines) are common in the domain of embedded systems (some example in C++). In other domains it seems like it is not that often required as i did not find an hierachical implementation example of the state pattern. There is a question on stackoverflow addressing this problem in Ruby (similar scripting language) which has not been solved for a year.
The conditions to enter inner states are application dependent. Events with or without guard condition checking can trigger a transition from one to another state. The challange with HSMs is to manage the transitions because they should be define-able beteen states in every hierarchie level (e.e. state "1.1" -> state "1.2" in the same superstate "1", state "1.1" in superstate "1" -> state "2.1" in superstate "2", etc.). The same should to be considered for entry actions and exit actions.
The UML extensions to the traditional FSM formalism is good further reading...
I am not a developer of this repo, but i will give a look in nested states.
Hey guys,
I apologize for not providing feedback sooner, I have been really pressed for time working on a project with a short deadline. I will spend sometime on this in the next couple of days and update the thread but from a quick gloss over I have some ideas I want to run by you guys.
Last weekend i tried to implement the C++ HSM example in python but i was not able to get it done completely. I could provide the stuff i came up till now with you guys. Just let me know how i can contribute/provide it to you. Another source for further reading is this python package supporting nested states.
I did not find any code which seems to handle "declaratives" for nested states. Is it possible to implement Hierarchical State Machines (HSMs) = FSM with nested states with this package somehow?