Zend Framework
1.12
|
Public Member Functions | |
__construct ($states=array(), $inputAphabet=array(), $rules=array()) | |
Finite State machine constructor. | |
addStates ($states) | |
Add states to the state machine. | |
addState ($state) | |
Add state to the state machine. | |
setState ($state) | |
Set FSM state. | |
getState () | |
Get FSM state. | |
addInputSymbols ($inputAphabet) | |
Add symbols to the input alphabet. | |
addInputSymbol ($inputSymbol) | |
Add symbol to the input alphabet. | |
addRules ($rules) | |
Add transition rules. | |
addRule ($sourceState, $input, $targetState, $inputAction=null) | |
Add symbol to the input alphabet. | |
addEntryAction ($state, Zend_Search_Lucene_FSMAction $action) | |
Add state entry action. | |
addExitAction ($state, Zend_Search_Lucene_FSMAction $action) | |
Add state exit action. | |
addInputAction ($state, $inputSymbol, Zend_Search_Lucene_FSMAction $action) | |
Add input action (defined by {state, input} pair). | |
addTransitionAction ($sourceState, $targetState, Zend_Search_Lucene_FSMAction $action) | |
Add transition action (defined by {state, input} pair). | |
process ($input) | |
Process an input. | |
reset () | |
__construct | ( | $states = array() , |
|
$inputAphabet = array() , |
|||
$rules = array() |
|||
) |
Finite State machine constructor.
$states is an array of integers or strings with a list of possible machine states constructor treats fist list element as a sturt state (assignes it to $_current state). It may be reassigned by setState() call. States list may be empty and can be extended later by addState() or addStates() calls.
$inputAphabet is the same as $states, but represents input alphabet it also may be extended later by addInputSymbols() or addInputSymbol() calls.
$rules parameter describes FSM transitions and has a structure: array( array(sourseState, input, targetState[, inputAction]), array(sourseState, input, targetState[, inputAction]), array(sourseState, input, targetState[, inputAction]), ... ) Rules also can be added later by addRules() and addRule() calls.
FSM actions are very flexible and may be defined by addEntryAction(), addExitAction(), addInputAction() and addTransitionAction() calls.
array | $states | |
array | $inputAphabet | |
array | $rules |
addEntryAction | ( | $state, | |
Zend_Search_Lucene_FSMAction | $action | ||
) |
Add state entry action.
Several entry actions are allowed. Action execution order is defined by addEntryAction() calls
integer | string | $state | |
Zend_Search_Lucene_FSMAction | $action |
addExitAction | ( | $state, | |
Zend_Search_Lucene_FSMAction | $action | ||
) |
Add state exit action.
Several exit actions are allowed. Action execution order is defined by addEntryAction() calls
integer | string | $state | |
Zend_Search_Lucene_FSMAction | $action |
addInputAction | ( | $state, | |
$inputSymbol, | |||
Zend_Search_Lucene_FSMAction | $action | ||
) |
Add input action (defined by {state, input} pair).
Several input actions are allowed. Action execution order is defined by addInputAction() calls
integer | string | $state | |
integer | string | $input | |
Zend_Search_Lucene_FSMAction | $action |
addInputSymbol | ( | $inputSymbol | ) |
Add symbol to the input alphabet.
integer | string | $inputSymbol |
addInputSymbols | ( | $inputAphabet | ) |
Add symbols to the input alphabet.
array | $inputAphabet |
addRule | ( | $sourceState, | |
$input, | |||
$targetState, | |||
$inputAction = null |
|||
) |
Add symbol to the input alphabet.
integer | string | $sourceState | |
integer | string | $input | |
integer | string | $targetState | |
Zend_Search_Lucene_FSMAction | null | $inputAction |
Zend_Search_Exception |
addRules | ( | $rules | ) |
Add transition rules.
array structure: array( array(sourseState, input, targetState[, inputAction]), array(sourseState, input, targetState[, inputAction]), array(sourseState, input, targetState[, inputAction]), ... )
array | $rules |
addState | ( | $state | ) |
Add state to the state machine.
integer | string | $state |
addStates | ( | $states | ) |
Add states to the state machine.
array | $states |
addTransitionAction | ( | $sourceState, | |
$targetState, | |||
Zend_Search_Lucene_FSMAction | $action | ||
) |
Add transition action (defined by {state, input} pair).
Several transition actions are allowed. Action execution order is defined by addTransitionAction() calls
integer | string | $sourceState | |
integer | string | $targetState | |
Zend_Search_Lucene_FSMAction | $action |
getState | ( | ) |
Get FSM state.
process | ( | $input | ) |
reset | ( | ) |
setState | ( | $state | ) |
Set FSM state.
No any action is invoked
integer | string | $state |
Zend_Search_Exception |