Closed ghost closed 3 years ago
Hi @floanwelt
In general, loops are valid in some machines and invalid in others, so you do need to indicate which loops are valid. However, loops, and empty loops at that, are a common use case, and the current solution of
is_A.upon(became_A, enter=is_A, outputs=[])
can be made more ergonomic. This is what issue #17 covers. If both enter
, and outputs
were optional, this would be
is_A.upon(became_A)
is_B.upon(became_B)
which says that these self-loops are valid but should do nothing. I am closing this issue since explicit, but ergonomic, self-loops are covered by #17.
I am using an implementation in which a periodic interval is updating the state of my machine. The way it is implemented the state change is triggered no matter if the machine has that state already. i.e. if my machine is in state A and the periodic state update mechanism says it should be in state A it will trigger input for state A. I found it going against the pattern to write a transition case to go from state A into state A but this way
NoTransition
errors are being raised. Since I could not find much about it in the documentation I was wondering if there are best practices on approaching this kind of scenario with automat or if this should be implemented also to not raise an error in this case.See attached some dummy code to shine some light on my implementation: