Talk:State machine design

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
 
Line 3: Line 3:
 
[[Image:StateMachine.png]]
 
[[Image: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.
+
* 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.
 
* 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.
 
* 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.

Latest revision as of 00:41, 15 August 2009

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