python-statemachine icon indicating copy to clipboard operation
python-statemachine copied to clipboard

how can I define the final state for a state machine

Open hwerbi opened this issue 4 years ago • 4 comments

  • 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

hwerbi avatar May 31 '20 20:05 hwerbi

Wouldn't that just be a state that can't transition to anything?

taybin avatar Jun 15 '20 22:06 taybin

Yes it can be in practice, but in state machine foundation a final state is required for the definition.

hwerbi avatar Jul 10 '20 08:07 hwerbi

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.

brunolnetto avatar Feb 10 '21 21:02 brunolnetto

I vote to close this issue.

brunolnetto avatar Feb 10 '21 21:02 brunolnetto

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.

brunolnetto avatar Dec 10 '22 22:12 brunolnetto

Thanks for your time reporting this @hwerbi .

This was finally done on https://github.com/fgmacedo/python-statemachine/pull/288

fgmacedo avatar Dec 20 '22 21:12 fgmacedo