COMP 405/505
Spring 2016
|
Self-Modifying Finite
State Machine Demo
|
 |
The demo should load and display automatically.
In a nutshell, the demo shows a finite state machine with the ability to
transition from state to state. Run-time selectable options will
modify the state transition behavior. The tool tips in the demo will tell
you most of what everything does.
Descriptons of Selected Operations
- The Make States button will add the designated number
of new states to the system. Every state will always have a unique
identifying index value.
- The Make Transition Algo button will create a
transition algorithm that, when the No-op option is
selected, will create a circular transition path that will cycle through
every available state exactly once.
Note that the transitions may not be in numerical order (to see this, make
about 20 states).
Description of the Options (Be sure to
change back to No-op after you are done inserting or deleting!)
- No-op: The system simply transitions to one of
the available states. The transitions are not modified.
This is considered the default behavior.
- Insert new state: Inserts a new state into the system
and transitions to it. The transitions are modified such that the
current state will always transition by default to the new state and the new
state will transition to where the current state used to transition to.
- Delete state: Removes the next state in the transition
order from the system and changes the transition algo so that the current
state will by default transition to where the deleted state used to
transition to.
The source code is available in the Comp405 repository:
https://svn.rice.edu/r/comp405/course/FSM_selfmod
UML Diagram of the Extended Visitor Design Pattern
Implementation

© 2013 by Stephen Wong
© 2015 by Stephen Wong