Creating a sketch of the Mealy machine system
3 unresolved threads
3 unresolved threads
Compare changes
+ 192
− 0
Messing around making a prototype of the capability execution state machine system.
this class name could conflict with the Python built-in Pattern
(don't forget FKs)
I'm confused about the purpose of this method for a state. Can you expound a little on why we'd need to determine if two states match?
This is because we can't unconditionally take a transition to a certain state just because we got an event that matches the pattern. The way the Mealy machine works, we have a rule for going from state A to state B, so we have to be sure we're actually in state A.
Oh, ok. So can I think of this as a kind of implementation of Python's
__eq__
?It will probably wind up being "State 1" == "State 2", but I wanted to be explicit that we need to make sure that two states match lower down in the prototype, and I don't want to make an implicit dependency on states being strings.