next up previous contents index
Next: 6.3 Default Interfaces Up: 6. SVM - A Previous: 6.1 An Introduction to   Contents   Index

6.2 The Design of SVM

Figure 6.1: SVM class design
Image svmclasses

The class design of SVM is shown in Figure 6.1. (This class diagram only shows the important attributes and methods.) Class EventHandler is the main class that loads the model from a text file, builds internal data structures for the model, and simulates the model on demand. It can be used with different user interfaces: the TextualInterface class defines the default textual interface that accepts input and produces output on the console; the GraphicalInterface class defines the default graphical interface; and the CursesInterface class defines the default curses interface (for UNIX only) to be used in the text mode with colors. Designers may define model-specific interfaces. Examples of model-specific interfaces are discussed in later chapters.

Class SVMFrontEnd provides a front end of the simulation environment for the end users. It accepts command-line parameters and initializes an instance of EventHandler with the model description. It also interacts with the model user through one of the user interfaces.

Class Generator uses EventHandler to parse DCharts models. It generates source code in different target-languages from the internal structures created by EventHandler. Class SCCFrontEnd provides a command-line front end for the code generator.

As EventHandler is the core of the parser and the simulator, it is necessary to introduce some of its methods and attributes here:

To simulate DCharts models, EventHandler requires the support of other classes. These classes are not necessary for code generation in SCC:

The EventHandler class is a parser and a simulator. It can be reused in other applications. For example, the SCC code synthesizer uses this class to parse textual model descriptions; an application that needs a DCharts simulator (such as AToM$^3$ with the DCharts plugin) may use it to simulate models.

The command-line to invoke SVM is discussed in [39]. It includes a complete description on how to start the simulation of a model, how to choose among the default interfaces, and how to redefine macros for the model.


next up previous contents index
Next: 6.3 Default Interfaces Up: 6. SVM - A Previous: 6.1 An Introduction to   Contents   Index
Thomas Huining Feng 2004-04-28