
VariableClock |
ptolemy.actor.lib.VariableClock |
This actor is identical to Clock except that it has an additional
input port, periodControl. If this port has a token when the actor
fires, then the value read from that port is used to set the parameter
value. The initial value of the period parameter is used before
any input is observed on periodControl.
This actor can be fairly tricky to use with multiple values and
offsets because of the constraint that all offsets must be less
than the period. Thus, the default values and offsets are different
from those of the base class. The output value, by default, is
just the constant integer 1, and the offset is 0.0. The default
value of period is changed to 1.0. This gives
a very simply behavior, where the output is always the same, but
the time between outputs is controlled by the periodControl
input.
In some domains, such as DE, an input at periodControl
is sufficient to trigger a firing. This can be somewhat counterintuitive,
since an output from the clock may not be expected at that time.
To avoid this, simple ensure that events at periodControl
arrive only at times when an output is expected.
Author(s): Edward A. Lee
Version:$Id: VariableClock.java,v 1.29 2005/07/08 19:56:11 cxh Exp $
Pt.Proposed Rating:Yellow (eal)
Pt.Accepted Rating:Yellow (yuhong)
periodControl
The port that controls the value of the period parameter.