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

cutes it forever, until you hit the “Stop” button).<br />

The structure of the above MoML text is explained in detail in this chapter. A more interesting<br />

example is given in the appendix to this chapter. You may wish to refer to that example as you read<br />

about the details. The next chapter explains how to bypass MoML and write applets directly. The chapter<br />

after that describes the actors libraries that are included in the current Ptolemy <strong>II</strong> version.<br />

7.2 MoML Principles<br />

The key features of MoML include:<br />

Web integration. MoML is an XML schema. XML, the popular extensible markup language[137],<br />

provides a standard syntax and a standard way of defining the content within that syntax. The syntax<br />

is a subset of SGML[138], and is similar to HTML. It is intended for use on the Internet, and is<br />

intended for precisely this sort of specialization into schemas. File references are via URIs (in<br />

practice, URLs), both relative and absolute, so MoML is equally comfortable working in applets<br />

and applications.<br />

Implementation independence. MoML is designed to work with a variety of tools. A modeling tool<br />

that reads MoML files is expected to provide a class loader in some form. Given the name of a<br />

class, and possibly a URL for the class definition, the class loader must be able to instantiate it.<br />

Classes might be defined in MoML or in some base language such as Java. In Java, the class loader<br />

could be that built in to the JVM. In C++ or other languages, the class loader would have to be<br />

implemented by the modeling tool. Ptolemy <strong>II</strong> can be viewed as a reference implementation of a<br />

MoML tool that uses Java as its base language.<br />

Extensibility. Components can be parameterized in two ways. First, they can have named properties<br />

with string values. Second, they can be associated with an external configuration file that can<br />

be in any format understood by the component. Typically, the configuration will be in some other<br />

XML schema, such as PlotML or SVG (scalable vector graphics).<br />

Classes and inheritance. Components can be defined in MoML as classes which can then be<br />

FIGURE 7.2. Simple example of a Ptolemy <strong>II</strong> model execution control window.<br />

Heterogeneous Concurrent Modeling and Design 193

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

Saved successfully!

Ooh no, something went wrong!