Class EventSource

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

    @Deprecated
    public class EventSource
    extends TypedAtomicActor
    This actor outputs a set of events at a discrete set of time points. It can be used to generate impulses in Continuous models. Events are produced at superdense time index 1 or greater in order to ensure that the output is piecewise continuous.

    This actor only generates predictable events and that is why it does not implement the ContinuousStepSizeControlActor interface. This actor requests a refiring in its initialize() method to produce events. During its postfire() method, it requests further firings to produce more events if necessary.

    Since:
    Ptolemy II 6.0
    Version:
    $Id$
    Author:
    Haiyang Zheng
    Pt.AcceptedRating:
    Yellow (hyzheng)
    Pt.ProposedRating:
    Yellow (hyzheng)
    • Field Detail

      • output

        public TypedIOPort output
        Deprecated.
        The output port. The type of this port is determined by from the values parameter.
      • offsets

        public Parameter offsets
        Deprecated.
        The offsets at which the specified values will be produced. This parameter must contain an array of doubles, and it defaults to {0.0, 1.0}.
      • period

        public Parameter period
        Deprecated.
        The period of the output events. This parameter must contain a DoubleToken, and defaults to 2.0.
      • values

        public Parameter values
        Deprecated.
        The values that will be produced at the specified offsets. This parameter must contain an ArrayToken, and defaults to {1, 0}.
    • Constructor Detail

      • EventSource

        public EventSource​(CompositeEntity container,
                           java.lang.String name)
                    throws IllegalActionException,
                           NameDuplicationException
        Deprecated.
        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 container.
        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.
    • Method Detail

      • attributeChanged

        public void attributeChanged​(Attribute attribute)
                              throws IllegalActionException
        Deprecated.
        If the argument is the offsets parameter, check that the array is nondecreasing and has the right dimension; if the argument is period, check that it is positive. Other sanity checks with period and values are done in the fire() method.
        Overrides:
        attributeChanged in class NamedObj
        Parameters:
        attribute - The attribute that changed.
        Throws:
        IllegalActionException - If the offsets array is not nondecreasing and nonnegative, or it is not a row vector.
      • clone

        public java.lang.Object clone​(Workspace workspace)
                               throws java.lang.CloneNotSupportedException
        Deprecated.
        Clone the actor into the specified workspace. This calls the base class and then sets the parameter public members to refer to the parameters of the new actor.
        Overrides:
        clone in class TypedAtomicActor
        Parameters:
        workspace - The workspace for the new object.
        Returns:
        A new actor.
        Throws:
        java.lang.CloneNotSupportedException - If a derived class contains an attribute that cannot be cloned.
        See Also:
        NamedObj.exportMoML(Writer, int, String), NamedObj.setDeferringChangeRequests(boolean)
      • postfire

        public boolean postfire()
                         throws IllegalActionException
        Deprecated.
        Update the state of the actor and schedule the next firing, if the director is in the discrete phase.
        Specified by:
        postfire in interface Executable
        Overrides:
        postfire in class AtomicActor<TypedIOPort>
        Returns:
        True if execution can continue into the next iteration.
        Throws:
        IllegalActionException - If the director throws it when scheduling the next firing, or if the length of the values and offsets parameters don't match, or if the director does not agree to fire the actor at the specified time.