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 />

ptolemy.kernel.util.NamedObj or any derived class, although most useful models will be<br />

instances of ptolemy.kernel.CompositeEntity or a derived class. TypedCompositeActor,<br />

as in the above example, is derived from CompositeEntity.<br />

7.3.5 Entity Element<br />

A model typically contains entities, as in the following Ptolemy <strong>II</strong> example:<br />

<br />

<br />

<br />

<br />

<br />

<br />

Notice the common XML shorthand here of writing “” rather than “.” Of course, the shorthand only works if there is nothing in the body of the entity<br />

element.<br />

An entity can contain other entities, as shown in this example:<br />

<br />

<br />

<br />

<br />

<br />

An entity must specify a class unless the entity already exists in the containing entity or model. The<br />

name of the entity reflects the container hierarchy. Thus, in the above example, the source entity has<br />

the full name “.pt<strong>II</strong>model.container.source”.<br />

The definition of an entity can be distributed in the MoML file. Once created, it can be referred to<br />

again by name as follows:<br />

<br />

<br />

...<br />

<br />

<br />

<br />

<br />

The property element (see section 7.3.6 below) is added to the pre-existing entity with name “x” when<br />

the second entity element is encountered.<br />

In principle, MoML supports multiple containment, as in the following:<br />

<br />

<br />

...<br />

200 Ptolemy <strong>II</strong>

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

Saved successfully!

Ooh no, something went wrong!