python-statemachine
python-statemachine copied to clipboard
how can I define the final state for a state machine
- Python State Machine version: 0.8.0
- Python version: 3.7
- Operating System: windows 10
Description
I am creating a state machine and I would like to know if it is possible to define a final state as we do in initial state
begin= State('begin', initial=True)
Any help will be appreciated
Wouldn't that just be a state that can't transition to anything?
Yes it can be in practice, but in state machine foundation a final state is required for the definition.
Let a graph \mathcal{F} given by initial state and respective transitions, it MUST NOT have a final state but an adjacency matrix. There may have cyclic and short paths, but a final state is a goal, not a necessary definition.
I vote to close this issue.
In regard to this issue still: In case we consider only directed graphs and a feasible state-machine, it requires a final state. I think, there are other features on the backlog with greater relevance than this, although it seems a valid point.
Thanks for your time reporting this @hwerbi .
This was finally done on https://github.com/fgmacedo/python-statemachine/pull/288