I know that I am a noob, but to be very honest, I don’t understand a single word about the “New” implemention - what it does, where, how and why.
How do you start that finite state machine? How is it reacting after being started? Is there a way to interact with them?
Where is the capitalization in the code?
A dot between a function and its corresponding attributes? What value should ‘String’ be to have a example with the traffic light example? Where does the “if request == …” get its content from? Or do you need to call request.(‘advance’) everytime you want to let the FSM go to the next step?
Tbh: I understood nearly nothing from this section… And I am not sure if its my noobieness or a somewhat complex written manual section
I think this is not one of our clearer manual pages. It really should be rewritten; maybe I’ll get a chance to take a stab at this in the next couple of days.
It’s “started” automatically; that is, it is initially in a state, which happens to be named “Off”. But it doesn’t run by itself; it just changes states whenever you give it input.
The only way you “interact” with an FSM is to give it input, e.g. via the request() method. This causes it to flip to some other state, most often the state name you passed to request() (in simple cases), or a state that logically follows from the input string you gave it (in more sophisticated cases).
The capitalization of the state names is mainly a convention; there’s very little in the base-level FSM code that enforces this. It’s just a suggestion for how you should set up your own FSM’s. However, FSM.defaultFilter() does behave differently for a transition request with an initial uppercase letter.
That dot looks like a typo. The value of ‘’ there should be any appropriate input for the FSM. In the traffic light example, ‘advance’ is the only appropriate input. Other FSM’s might accept different kinds of input strings, depending on how you define them.
Indeed, it does… Thanks for the fast reply! Would be nice to see there some improvements… especcially because the manual is referring still to the old FSMs that “is only there because older versions used it” - So for me, they are somewhat useless, but the text of the current FSMs is saying “like the old behavior” - what is somewhat mis-placed
Just wanted to bring that section to your attention… its no problem if it doesn’t happen to get updated today or tomorrow… but maybe if somebody(!) has time(!), he might want to do something in that section