State ExplosionJuly 1, 2018 at 10:14am
I put the finishing touches on the page on State Explosion just now. Lots of hand-drawn images. To pre-empt the question on what I use to draw the statecharts, I use BoxySVG, which works well with my Chromebook!
Give it a read and feel free to use it if you ever need to explain the state explosion problem of state machines!
And as always, feedback is very welcome.
July 1, 2018 at 3:51pm
(The content is great, by the way!)
Thanks for mentioning the missing dashes. I used the wrong type of line for those dashes (or they were maybe a tad too thin).
Fixed the diagrams! :tada:
July 2, 2018 at 4:01am
Looks great! Don't know if this is worth putting in the docs but another subtle advantage of hierarchies I've found is that they can help model 'AnyState'. Some state machine implementations like Unity's Mechanim and SwiftState have this extra concept. In the hierarchies diagram instead of having an event
u1 from 'Valid' -> 'Unchanged' and another event
u2 from 'Invalid' to 'Unchanged' there's just one
u event from the child state chart to the parent. Basically, "if I am in any state in Changed and the event
u happens, transition to Unchanged". It's a small distinction but if you are coming from other state machine impls and wondering how to model 'AnyState' with state charts, hierarchies can help.
> Some statechart systems have a concept of "Any State" — one that is always active. Unity's Animation State Machines (where it's called "Any State") and SwiftState (where `nil` denotes the any state) are a couple of examples. The transitions defined for the "Any State" will always_ be in play. A compound state can play the same role as the Any State, by defining a single top level state to hold those types of transitions.
↑ Just adding that.
July 2, 2018 at 4:55pm