[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/search/Zend/Search/Lucene/ -> FSM.php (summary)

Zend Framework LICENSE

Copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
License: http://framework.zend.com/license/new-bsd New BSD License
File Size: 433 lines (13 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 15 functions

  __construct()
  addStates()
  addState()
  setState()
  getState()
  addInputSymbols()
  addInputSymbol()
  addRules()
  addRule()
  addEntryAction()
  addExitAction()
  addInputAction()
  addTransitionAction()
  process()
  reset()

Functions
Functions that are not part of a class:

__construct($states = array()   X-Ref
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.

param: array $states
param: array $inputAphabet
param: array $rules

addStates($states)   X-Ref
Add states to the state machine

param: array $states

addState($state)   X-Ref
Add state to the state machine

param: integer|string $state

setState($state)   X-Ref
Set FSM state.
No any action is invoked

param: integer|string $state

getState()   X-Ref
Get FSM state.

return: integer|string $state|null

addInputSymbols($inputAphabet)   X-Ref
Add symbols to the input alphabet

param: array $inputAphabet

addInputSymbol($inputSymbol)   X-Ref
Add symbol to the input alphabet

param: integer|string $inputSymbol

addRules($rules)   X-Ref
Add transition rules

array structure:
array( array(sourseState, input, targetState[, inputAction]),
array(sourseState, input, targetState[, inputAction]),
array(sourseState, input, targetState[, inputAction]),
...
)

param: array $rules

addRule($sourceState, $input, $targetState, $inputAction = null)   X-Ref
Add symbol to the input alphabet

param: integer|string $sourceState
param: integer|string $input
param: integer|string $targetState
param: Zend_Search_Lucene_FSMAction|null $inputAction

addEntryAction($state, Zend_Search_Lucene_FSMAction $action)   X-Ref
Add state entry action.
Several entry actions are allowed.
Action execution order is defined by addEntryAction() calls

param: integer|string $state
param: Zend_Search_Lucene_FSMAction $action

addExitAction($state, Zend_Search_Lucene_FSMAction $action)   X-Ref
Add state exit action.
Several exit actions are allowed.
Action execution order is defined by addEntryAction() calls

param: integer|string $state
param: Zend_Search_Lucene_FSMAction $action

addInputAction($state, $inputSymbol, Zend_Search_Lucene_FSMAction $action)   X-Ref
Add input action (defined by {state, input} pair).
Several input actions are allowed.
Action execution order is defined by addInputAction() calls

param: integer|string $state
param: integer|string $input
param: Zend_Search_Lucene_FSMAction $action

addTransitionAction($sourceState, $targetState, Zend_Search_Lucene_FSMAction $action)   X-Ref
Add transition action (defined by {state, input} pair).
Several transition actions are allowed.
Action execution order is defined by addTransitionAction() calls

param: integer|string $sourceState
param: integer|string $targetState
param: Zend_Search_Lucene_FSMAction $action

process($input)   X-Ref
Process an input

param: mixed $input

reset()   X-Ref
No description



Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7