Talk:State machine design

From CSSEMediaWiki
Revision as of 00:29, 15 August 2009 by Aidan Bebbington (Talk | contribs)
Jump to: navigation, search

There are a few things wrong with the following diagram:

StateMachine.png

  • The setCurrentState() method should be defined in FSM, and implmented in both subclasses. This will replace DeterministicFSM.setCurrentState() and NondeterministicFSM.setCurrentStates(). To allow this NondeterminsticFSM will allow it to be called several times to allow multiple states to be activated.
  • Similarly, the step() method should be defined in State, and implemented in both subclasses. This method should take an FSM, not a concrete machine class.
  • State should not have the field transitions. This will have to be defined in the subclasses to allow NondeterministicState to have multiple transitions on a single state and input.
  • FSM.run() should take a List not a Collection since order of input is very important.

--Aidan 00:28, 15 August 2009 (UTC)

Personal tools