Packagewk.automaton
Classpublic class WK_Automaton
InheritanceWK_Automaton Inheritance flash.events.EventDispatcher
Implements WKI_Automaton
Subclasses WK_MealyMachine, WK_MealyMachineSimplified, WK_MooreMachine, WK_MooreMachineSimplified

Language Version : ActionScript 3.0

An abstract class for automatons. The method doAction should be overridden by subclasses.



Public Properties
 PropertyDefined By
  transitionFunction : Object
The transition function of the automaton (stored within a hash map).
WK_Automaton
Protected Properties
 PropertyDefined By
  currentState : String
The current state of the automaton.
WK_Automaton
  initialState : String
The initial state of the automaton.
WK_Automaton
Public Methods
 MethodDefined By
  
WK_Automaton(p_initial_state:String)
WK_Automaton
  
doAction(p_action:String):void
Switches the automaton into a new state depending on the current state and the user action p_action.
WK_Automaton
  
reset():void
Resets the automaton.
WK_Automaton
Protected Constants
 ConstantDefined By
  DEFAULT : String = DEFAULT
[static]
WK_Automaton
Property Detail
currentStateproperty
protected var currentState:String

The current state of the automaton.

initialStateproperty 
protected var initialState:String

The initial state of the automaton.

transitionFunctionproperty 
transitionFunction:Object

The transition function of the automaton (stored within a hash map).


Implementation
    public function get transitionFunction():Object
    public function set transitionFunction(value:Object):void
Constructor Detail
WK_Automaton()Constructor
public function WK_Automaton(p_initial_state:String)

Parameters
p_initial_state:String — state The initial state of the automaton.
Method Detail
doAction()method
public function doAction(p_action:String):void

Switches the automaton into a new state depending on the current state and the user action p_action. Several WK_AutomatonEvents may be dispatched.

Parameters

p_action:String — The (user) action that determines the transition to be used.

reset()method 
public function reset():void

Resets the automaton. That is to say, the current state is set to the initial state, an an event of type WK_Automaton.INIT is dispatched. As parameters, EventINIT (as action), the current state and an empty string (for the previous state) are stored in that event.

Constant Detail
DEFAULTConstant
protected static const DEFAULT:String = DEFAULT