Talk:State machine design

From CSSEMediaWiki
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 implemented in both subclasses. This will replace DeterministicFSM.setCurrentState() and NondeterministicFSM.setCurrentStates(). NondeterminsticFSM will allow it to be called several times activate multiple states.
  • 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.

That said, my diagram is considerably messier. Stupid Dia! Really should stop using that. Feel free to change your diagram and replace mine on the main page. --Aidan 00:28, 15 August 2009 (UTC)

Personal tools