CS522A (Fall 2003) Assignment 3 - SOLUTION


Download: [PDF] [PS]



The only assumption is that the MP3 file that this MP3 player plays is not currupted. In that case, it is very hard to tell how the statechart model and the underlying PyGame library would behave.

As a side remark, it is very hard to capture exceptions in a statechart model. In an other word, statecharts are not fault tolerant. One has to ensure that the model will never go to a ``strange'' state (or unexpected state). If this happens, usually the simulation does not crash but just reacts in a strange way, or does not react at all!


The textural design is written (manually) in MP3Solution.des. To run this model, these files in the distribution package are necessary: MP3Library.py (MP3 hardware library), MP3PlayerGUI.py (MP3 model-specific graphical interface), Fwd.gif, PlayPause.gif, Rew.gif and Stop.gif.

Figure 1 shows the equivalent graphical representation of this statechart model.

Figure 1: Graphical statechart model for MP3 player

Brief Explanation

There are some notes for this model:


... useful.1
The use of macros also limits language dependency. To port a Python model to Java only requires rewriting the set of macros.

Hans Vangheluwe 2003-12-04