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.

MoML<br />

This class extends Gen by adding two properties, and then sets the properties of the component entities<br />

to have values that are expressions.<br />

7.3.11 Inheritance<br />

MoML supports inheritance by permitting you to extend existing classes. For example, consider<br />

the following MoML file:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Here, the “derived” class extends the “base” class by adding another entity to it, and “instance” is an<br />

instance of derived. The class “derived” can also give a source attribute, which gives a URL for the<br />

source definition.<br />

A derived class (or subclass) can contain additional entities, relations, ports, and links. However, it<br />

cannot remove entities, relations, ports or links defined in the base class. Moreover, it cannot add links<br />

that are exclusively between ports and relations defined in the base class. New links must involve<br />

either a port or a relation that is new in the derived class.<br />

7.3.12 Directors<br />

Recall that a clustered graph in MoML has no semantics. However, a particular model has semantics.<br />

It may be a dataflow graph, a state machine, a process network, or something else. To give it<br />

semantics, Ptolemy <strong>II</strong> requires the specification of a director associated with a model, an entity, or a<br />

class. The director is a property of the model. The following example gives discrete-event semantics to<br />

a Ptolemy <strong>II</strong> model:<br />

<br />

<br />

<br />

<br />

...<br />

<br />

This example also sets a property of the director. The name of the director is not important, except that<br />

210 Ptolemy <strong>II</strong>

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

Saved successfully!

Ooh no, something went wrong!