Home Cavernosa
PyGLUT GAME BOY
ADVANCE
Nintendo DS Java
Misc Code Links
My Site
Intro
Cavernosa
PyGLUT
Game Boy Advance
Nintendo DS
Java
Misc Code
Links
 
Java
Intro
 
Email me
mailto
 
Printer
Friendly

 
  

Java

Hierarchical State Machines
A Java implementation of the kind of hierarchical state machine described in the book Practical Statecharts in C/C++, Quantum Programming for Embedded Systems, by Miro Samek, Ph.D.

That book has box-outs detailing the tiny overhead of it's mechanisms in terms of assembly instruction counts. My version replaces those mechanisms with multiple hash table lookups and use of the Reflection API so does not offer the same level of performance. It also allocates from the garbage-collected heap as it runs, with the limit of the allocation load hard to determine, and spits out a little garbage for every transition.

I've also re-implemented the Calculator main motivating example statechart used in that book as a web applet:

Calc
<image src="CalcApplet.png" border=0>
If you can't see it or don't want to install the sun Java plugin try this page which uses the applet tag.

Copyright © Andrew H. Cox. All rights reserved.
ahcox@btinternet.com