Class ZeroOrderHold

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

    public class ZeroOrderHold
    extends Transformer
    Convert discrete events at the input to a continuous-time signal at the output by holding the value of the discrete event until the next discrete event arrives. Specifically, on each firing, if an input is present, then record the value of the input. Then produce the recorded value. Prior to receipt of the first input, output the token given by defaultValue, if one is given. This actor will throw an exception if the input is not purely discrete. Specifically, this means that when the input is present, the step size of the solver has to be 0.0.
    Since:
    Ptolemy II 6.0
    Version:
    $Id$
    Author:
    Edward A. Lee, Haiyang Zheng
    Pt.AcceptedRating:
    Red (hyzheng)
    Pt.ProposedRating:
    Green (hyzheng)
    • Field Detail

      • defaultValue

        public Parameter defaultValue
        Default output before any input has received. The default is empty, indicating that no output is produced until an input is received. The type of the output is set to at least the type of this parameter (and also at least the type of the input).
    • Constructor Detail

      • ZeroOrderHold

        public ZeroOrderHold​(CompositeEntity container,
                             java.lang.String name)
                      throws IllegalActionException,
                             NameDuplicationException
        Construct an actor in the specified container with the specified name. The name must be unique within the container or an exception is thrown. The container argument must not be null, or a NullPointerException will be thrown.
        Parameters:
        container - The subsystem that this actor is lived in
        name - The actor's name
        Throws:
        IllegalActionException - If the entity cannot be contained by the proposed container.
        NameDuplicationException - If name coincides with an entity already in the container.