03.08.2013 Views

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

MoML<br />

Suppose that using incremental parsing we subsequently modify the model as follows:<br />

<br />

<br />

<br />

That is, we add a port to the instantiated entity. Then the added port is exported when we export<br />

MoML. That is, we get:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

This is what we would expect. The entity is based on the specified class, but actually extends it with<br />

additional features. Those features are persistent.<br />

Properties are treated more simply. They are always described when MoML is exported, regardless<br />

of whether they are defined in the class on which an entity is based. The reason for this is that properties<br />

are usually modified in instances, for example by giving them new values.<br />

There is an additional subtlety. If a topology is modified by making direct kernel calls, then export-<br />

MoML() will normally export the modified topology. However, if a derived component is modified by<br />

direct kernel calls, then exportMoML() will fail to catch the changes. In fact, only if the changes are<br />

made by evaluating MoML will the modifications be exported. This actually can prove to be convenient.<br />

It means that if a model mutates during execution, and is later saved, that a user interface can<br />

ensure that only the original model, before mutations, is saved.<br />

7.7 Special Attributes<br />

The moml package also includes a set of attribute classes that decorate the objects in a model with<br />

MoML-specific information, as shown in figure 7.10. These classes are used to decorate a Ptolemy <strong>II</strong><br />

object with additional information that is relevant to a GUI or other user interface. For example, the<br />

Location class is used to specify the location of visual rendition of a component in a visual editor. A<br />

Vertex decorates a relation with one of several visual handles to which connections can be made. A<br />

MoMLAttribute decorates an object with a property that can describe itself with arbitrary MoML.<br />

7.8 Acknowledgements<br />

Many thanks to Ed Willink of Racal Research Ltd. and Simon North of Synopsys for many helpful<br />

suggestions, only some of which have made it into this version of MoML. Also, thanks to Tom Henzinger,<br />

Alberto Sangiovanni-Vincentelli, and Kees Vissers for helping clarify issues of abstract syntax.<br />

Heterogeneous Concurrent Modeling and Design 221

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

Saved successfully!

Ooh no, something went wrong!