Moore Type State Models
There are fundamentally two formulations of state machines.
- The Moore type machine has its action performed upon entry into the state.
- The Mealy type machine has its action performed upon exiting from the state.
The Detailed Rules
It's important to enumerate the exact rules of state machines that we intend to support:- The state model consists of a set of states that have relatively arbitrary names. Each state is associated with a body of Tcl code that is executed when the state is entered. A state may accept parameters.
- The state model responds to a set of events that also have relatively arbitrary names. Events may also carry parameters.
- The state model implements a set of transitions where an event is dispatched to a state machine causing a transition to a new state and the execution of the code associated with the state.
- A transition can be ignored by a state.
- A transition can be deemed a logical impossibility (i.e. it can't happen) and this is considered an error.
- Any event that causes a transition into a state must carry the same parameters that the state accepts.