I use Mathematica to develop methods for formal model-based user interface evaluation. Most of the methods require creating a finite state machine (FSM) of an interface, where the states are states of the interface and the transitions are actions initiated by the user. If you think about a 4 function calculator, the actions are all of the buttons and the state contains the contents of the display plus any internal variables required to compute the next visible state, given any button press. One way to create the FSM is to define a function that takes a button and the current state and produces the next state. Starting with the initial state of the device, a tree search produces a complete FSM for the interface.
As I apply these methods to more complex interfaces, It seems easier and more efficient to first model interfaces using something like UML/Harel statecharts, then convert those charts to an FSMs. Statecharts contain abstractions that greatly reduce the number of states and also make fairly complex event-driven behavior less error prone to model/program.
After downloading the trial of SystemModeler and spending a few hours working with it, I cannot tell at all whether I can create the kinds of event-driven models that I need, or even how to go about doing this. Modelica's Stategraph library claims to have Harel statechart power, but the modelica documentation is rather poor and all of the examples in SystemModeler/Modelica seem to use time-based or equation-based transitions. In contrast, Harel/UML statecharts are based on events (such as "+ pressed"). In addiiton, transitions can raise events that are then processed throughout the chart. In one example, I have two pull down menus. Making a choice from the first does not affect the second, but making a choice in the second, sets the first to the same value. The statechart I've attached here is showing the model for one of these pull down menus. In this case, there are two orthogonal parts to the state: the menu is either open or closed and is simultaneously in one of the states shown on the right.
So my question is whether this is possible in SystemModeler and, if so, is it possible to find better documentation/examples on how to do it?
Second, it is possible to see the chart with the current state(s) highlighted as I send events to it? In the attached image, the yellow states are active and I can click events from an event list (not shown) to trigger the next event and state transition.
Right now, I'm using Yakindu statechart tools (the source of this image), because it is free to me, and allows graphical simulation while viewing the statechart. Yakindu can create Java code of the statechart that I can then access from MMA to build the FSM using depth-first search over the event and state space. Unfortunately, Yakindu is based on Eclipse and its user interface leaves a lot to be desired, plus I've not found a way to edit the textual descriptions of the model (which is often easier than using a GUI).
Todd
Attachments: