Robami / pystatecharts

Automatically exported from code.google.com/p/pystatecharts
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

new feature - state query, alternative methods for... #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I would like to create a simulator out of the statechart for the statechart.
To do this, I would need to query the system to determine what states are valid.
Right now, the only way to query the system is to send an event that causes a 
transition,
which would be a bad thing (like an electron - you can know velocity or 
direction, but not both
at the same time).

Would it make sense to add events that cause the state to begin and end a the 
same state
i.e. transition from A to A, and as an action generate a print statement? If 
the state is not currently valid, then nothing would happen but if a state were 
valid I would have some feedback.

Does this make sense?

Original issue reported on code.google.com by r...@haystack.mit.edu on 16 Nov 2010 at 6:29

GoogleCodeExporter commented 8 years ago
I figured out how to do this through the field statechart.runtime.is_active 
method,
although state A-to-A transitions kicking off events also work 

Original comment by r...@haystack.mit.edu on 23 Nov 2010 at 6:18

GoogleCodeExporter commented 8 years ago

Original comment by vish...@gmail.com on 14 Apr 2011 at 6:35