Fix root node edge case for `State` instance
Overview
This PR resolves a bug introduced in !127 (merged) whereby the root State
object was missing a Transition()
that "caused" it. Prior to !127 (merged), each State
instance managed its own transitions. Now, however, the ActorState
instances manage transitions, and each State
instance merely points to one of those transitions.
Many functions queried each state's transition, so the bug appeared in numerous places. Typically, however, this extra information was extracted by log functions, so the bugs would only appear when logging was enabled at a certain verbosity.
This should resolve the test failures with the model checker. Semantically, it may make more sense to have a std::optional<Transition*>
to better the lack of a transition; otherwise, we could simply force other locations to handle the case where a transition is missing (e.g. from the root state). Do mention if you think there is a better way to resolve this particular issue.