Talk:State machine design

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
Line 7: Line 7:
 
* 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.
 
* 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.
 
* 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 it on the main page.
+
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.
 
--[[User:Aidan Bebbington|Aidan]] 00:28, 15 August 2009 (UTC)
 
--[[User:Aidan Bebbington|Aidan]] 00:28, 15 August 2009 (UTC)

Revision as of 00:37, 15 August 2009

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.

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