03.08.2013 Views

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Using Vergil<br />

resulting icon for the subclass appears right on top of the icon for the class, so it needs to be moved<br />

over, as shown in the figure.<br />

Looking inside the subclass reveals that it contains all the elements of the class, but with their<br />

icons now surrounded by a dashed pink outline. These elements are inherited. They cannot be removed<br />

from the subclass (try to do so, and you will get an error message). You can, however, change their<br />

parameter values and add additional elements. Consider the design shown in figure 2.40, which adds<br />

an additional pair of parameters named “interferenceAmplitude” and “interferenceFrequency” and an<br />

additional pair of actors implementing the interference. A model that replaces the last channel with an<br />

instance of the subclass is shown in figure 2.41, along with a plot where you can see the sinusoidal<br />

interference.<br />

An instance of a class may be created anywhere in a hierarchical model that is either in the same<br />

composite as the class or in a composite contained by that composite. To put an instance into a sub-<br />

FIGURE 2.37. The model from figure 2.36 with the icon changed for the class. Note that changes to the<br />

base class propagate to the instances.<br />

FIGURE 2.38. The model from figure 2.37 with the icons of the instance changed to override parameter<br />

values in the class.<br />

70 Ptolemy <strong>II</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!