A signal is a set of "events," each of which has a tag and value. The set of values includes a special element, called "absent", denoting the absence of a (normal) value. This director uses superdense time, where every event has a tag that is a member of the set RxN. R is a connected subset of the real numbers (giving "time", and approximated by instances of the Time class), and N is the natural numbers (giving an "index"). At a time t, a signal may have multiple values in sequence with tags (t, 0), (t, 1)... Its "initial value" is the value at tag (t, 0). It typically settles to a "final value" after a finite number of indices. If it fails to settle to a final value, the signal is said to have a "stuttering Zeno" condition, and time will not progress.
In our semantics, all signals are piecewise continuous. This means that the initial value, as a function of time, is continuous on the left, the final value, as a function of time, is continuous on the right, and the signal has exactly one value (meaning the initial value and the final value are the same) at all times except those on a discrete subset D.
A purely continuous signal has exactly one value at all times, meaning that the final value equals the initial value at all times. A purely discrete signal has initial value "absent" and final value "absent" at all times, and at a discrete subset of the times, it may have non-absent values. The only signal that is both purely continuous and purely discrete is the one that is absent at all tags.
A signal may be mostly continuous, but has multiple values at a discrete subset of times. These multiple values semantically represent discontinuities in a continuous signal that is not purely continuous.
The set of times where signals have more than one distinct value are a discrete subset D of the time set. These times are called "breakpoints" and are treated specially in the execution. Between these times, an ordinary differential equation (ODE) solver governs the execution. Initial values are always given by the ODE solver.
The parameters of this director are:
This director maintains a breakpoint table to record all predictable breakpoints that are greater than or equal to the current time. The breakpoints are sorted in their chronological order. Breakpoints at the same time are considered to be identical, and the breakpoint table does not contain duplicate time points. A breakpoint can be inserted into the table by calling the fireAt() method. The fireAt method may be requested by the director, which inserts the stop time of the execution. The fireAt method may also be requested by actors and the requested firing time will be inserted into the breakpoint table.
This director is designed to work with any other director that implements the actor semantics. As long as the other director does not commit state changes except in postfire, this director can be used within it, and it can be used within the model controlled by this director. Of course, the enclosing model must advance time, or model time will not progress beyond zero.
This director is based on the CTDirector by Jie Liu and Haiyang Zheng, but it has a much simpler scheduler. FIXME: the design of clone method should be examined and reimplemented. All Continuous files need this. @author Haiyang Zheng and Edward A. Lee @version $Id: ContinuousDirector.java,v 1.50 2007/12/07 06:27:42 cxh Exp $ @since Ptolemy II 6.0 @Pt.ProposedRating Yellow (hyzheng) @Pt.AcceptedRating Red (hyzheng)
|
|