Class Sequence

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

    public class Sequence
    extends TypedAtomicActor
    This actor produces a sequence of values, optionally periodically repeating them. The values parameter contains an ArrayToken that specifies the sequence of values to produce at the output. If the enable input port is connected, then it provides a boolean sequence that specifies whether to produce an output. If the enable is present and true, then the actor will produce the next output. Otherwise, it produces no output and will produce the next in the sequence on the next firing (if enable is true). If the holdLastOutput parameter is true, then the sequence is infinite, with the last value being repeated forever.

    Compared with the Pulse actor, this actor can be enabled or disabled on each firing by providing a true or false input on the enable port.

    Since:
    Ptolemy II 4.1
    Version:
    $Id$
    Author:
    Edward A. Lee
    See Also:
    Pulse
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Yellow (eal)
    • Field Detail

      • enable

        public TypedIOPort enable
        The enable input port. If this port is connected, then its input will determine whether an output is produced in any given firing. The type is boolean.
      • holdLastOutput

        public Parameter holdLastOutput
        A flag indicating whether to interpret the values as an infinite sequence where the last value is repeated forever. This is a boolean that defaults to false.
      • output

        public TypedIOPort output
        The output port. The type is greater than or equal to the types of the two input ports.
      • repeat

        public Parameter repeat
        The flag that indicates whether the sequence needs to be repeated. If this is false, then either the last value of the sequence is repeatedly produced after the entire sequence has been produced, or the actor stops producing output, depending on the value of holdLastOutput. This is a boolean, and defaults to false.
      • values

        public Parameter values
        The values that will be produced on the output. This parameter is an array, with default value {1}.