Class VariableClock

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TimedActor, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    @Deprecated
    public class VariableClock
    extends Clock
    Deprecated.
    Use Clock instead.
    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.

    Since:
    Ptolemy II 0.4
    Version:
    $Id$
    Author:
    Edward A. Lee
    Pt.AcceptedRating:
    Yellow (yuhong)
    Pt.ProposedRating:
    Yellow (eal)
    • Field Detail

      • periodControl

        public TypedIOPort periodControl
        Deprecated.
        The port that controls the value of the period parameter.
    • Method Detail

      • fire

        public void fire()
                  throws IllegalActionException
        Deprecated.
        If there is an input on the periodControl port, read it and set the value of the period parameter. Then call the base class fire() method.
        Specified by:
        fire in interface Executable
        Overrides:
        fire in class Clock
        Throws:
        IllegalActionException - If the input is not positive, or if the base class throws it.