1 Introduction
In Ptolemy II, models specify computations by composing actors. Many
computations, however, are awkward to specify this way. A common
situation is where we wish to evaluate a simple algebraic expression,
such as "sin(2π (x-1))." It is possible to express this
computation by composing actors in a block diagram, but it is far more
convenient to give it textually. actions in state machines, and for
the calculation performed by the Expression
actor. In fact, the expression language is part of the generic
infrastructure in Ptolemy II, and it can be used by programmers
extending the Ptolemy II system. In this chapter, we describe how to
use expressions from the perspective of a user rather than a
programmer.
1.1 Expression Evaluator
Vergil provides an interactive expression
evaluator, which is accessed through the File:New menu. This operates
like an interactive command shell, and is shown in figure
1. It supports a command history. To
access the previously entered expression, type the up arrow or
Control-P. To go back, type the down arrow or Control-N. The
expression evaluator is useful for experimenting with expressions.
Figure 1: The Expression Evaluator