new Automaton(automaton)
Whenever an action is performed, it changes its state due to the transition table given. The new state depends on the current state and the action performed.
On exiting a state the automaton dispatches the exit event of that state (if that event exists). Then it dispatches the do event of the current transition (if that event exits). On entering a state, it dispatches the entry event and then the do event of that state (if those events exist). If a transition does not lead to a new state, i.e., if the automaton remains in the current state, neither the exit event nor the entry event but only the do event of the transition an the do event of that state are dispatched.
In the transition table there can be noted a default action for every state. Whenever the automaton is in a specific state and there is no entry found for the current action, the default action is performed instead. If no default action is found, too, the automaton remains in the current state and an error event is dispatched (if it exists).
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
automaton |
Object |
Properties
|
- Source:
Members
-
lastAction
-
- Source:
-
previousState
-
- Source:
-
state
-
- Source:
Methods
-
action(p_action)
-
Performs an action on the automation. It reacts by changing its state an dispatching appropriate events.
Parameters:
Name Type Description p_actionstring - Source:
-
reset()
-
Resets the automaton to its initial state;
- Source: