Class SDFIOPort

  • All Implemented Interfaces:
    java.lang.Cloneable, HasTypeConstraints, Typeable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    @Deprecated
    public final class SDFIOPort
    extends TypedIOPort
    Deprecated.
    It is preferable to declare the rate parameters directly in the actors, instead of using this class. This allows the dependence of rates to be understood by various SDF schedulers.
    This class extends IOPort with convenience methods for handling the token production and consumption rates. These are merely convenience methods, as the pertinent attributes can be added to any IOPort and the SDF domain will respect them.

    It is not recommended to use this port as a port for composite actors because the presence of the rate parameters will prevent the inner SDF scheduler from propagating it rates to the outside. That is, if the parameters are present, the scheduler does not override them.

    Since:
    Ptolemy II 0.2
    Version:
    $Id$
    Author:
    Stephen Neuendorffer
    Pt.AcceptedRating:
    Yellow (johnr)
    Pt.ProposedRating:
    Yellow (neuendor)
    • Field Detail

      • tokenConsumptionRate

        public Parameter tokenConsumptionRate
        Deprecated.
        The number of tokens consumed on this port each firing.
      • tokenInitProduction

        public Parameter tokenInitProduction
        Deprecated.
        The number of tokens produced on this port during initialization.
      • tokenProductionRate

        public Parameter tokenProductionRate
        Deprecated.
        The number of tokens produced on this port each firing.
    • Constructor Detail

      • SDFIOPort

        public SDFIOPort()
        Deprecated.
        Construct an SDFIOPort with no container and no name that is neither an input nor an output.
      • SDFIOPort

        public SDFIOPort​(Workspace workspace)
                  throws IllegalActionException
        Deprecated.
        Construct a port in the specified workspace with an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace. The object is added to the workspace directory. Increment the version number of the workspace.
        Parameters:
        workspace - The workspace that will list the port.
        Throws:
        IllegalActionException - If port parameters cannot be initialized.
      • SDFIOPort

        public SDFIOPort​(ComponentEntity container,
                         java.lang.String name)
                  throws IllegalActionException,
                         NameDuplicationException
        Deprecated.
        Construct an SDFIOPort with a containing actor and a name that is neither an input nor an output. The specified container must implement the Actor interface, or an exception will be thrown.
        Parameters:
        container - The container actor.
        name - The name of the port.
        Throws:
        IllegalActionException - If the port is not of an acceptable class for the container, or if the container does not implement the Actor interface.
        NameDuplicationException - If the name coincides with a port already in the container.
      • SDFIOPort

        public SDFIOPort​(ComponentEntity container,
                         java.lang.String name,
                         boolean isInput,
                         boolean isOutput)
                  throws IllegalActionException,
                         NameDuplicationException
        Deprecated.
        Construct an SDFIOPort with a container and a name that is either an input, an output, or both, depending on the third and fourth arguments. The specified container must implement the Actor interface or an exception will be thrown.
        Parameters:
        container - The container actor.
        name - The name of the port.
        isInput - True if this is to be an input port.
        isOutput - True if this is to be an output port.
        Throws:
        IllegalActionException - If the port is not of an acceptable class for the container, or if the container does not implement the Actor interface.
        NameDuplicationException - If the name coincides with a port already in the container.
    • Method Detail

      • clone

        public java.lang.Object clone​(Workspace workspace)
                               throws java.lang.CloneNotSupportedException
        Deprecated.
        Clone the port into the specified workspace. This calls the base class and then creates new parameters. The new port will have the same parameter values as the old.
        Overrides:
        clone in class TypedIOPort
        Parameters:
        workspace - The workspace for the new object.
        Returns:
        A new SDFIOPort.
        Throws:
        java.lang.CloneNotSupportedException - If one of the attributes cannot be cloned.
        See Also:
        NamedObj.exportMoML(Writer, int, String), NamedObj.setDeferringChangeRequests(boolean)
      • getTokenConsumptionRate

        public int getTokenConsumptionRate()
                                    throws IllegalActionException
        Deprecated.
        Get the number of tokens that are consumed on every channel of this port.
        Returns:
        The number of tokens consumed on this port, as specified in the tokenConsumptionRate Parameter.
        Throws:
        IllegalActionException - If calling getToken() throws it.
        See Also:
        setTokenConsumptionRate(int)
      • getTokenInitProduction

        public int getTokenInitProduction()
                                   throws IllegalActionException
        Deprecated.
        Get the number of tokens that are produced on this port during initialization.
        Returns:
        The number of tokens produced on the port, as specified in the tokenInitProduction parameter.
        Throws:
        IllegalActionException - If calling getToken() throws it.
        See Also:
        setTokenInitProduction(int)
      • getTokenProductionRate

        public int getTokenProductionRate()
                                   throws IllegalActionException
        Deprecated.
        Get the number of tokens that are produced on the designated port of this Actor during each firing.
        Returns:
        The number of tokens produced on the port, as specified in the tokenProductionRate parameter.
        Throws:
        IllegalActionException - If calling getToken() throws it.
        See Also:
        setTokenProductionRate(int)
      • setInput

        public void setInput​(boolean isInput)
                      throws IllegalActionException
        Deprecated.
        Set whether or not this port is an input. In addition to the base class operation, set the port rate parameters to reasonable values. If setting the port to be an input, then set the consumption rate to be 1. If setting the port to not be an input, then set the consumption rate to be 0.
        Overrides:
        setInput in class IOPort
        Parameters:
        isInput - True to make the port an input.
        Throws:
        IllegalActionException - If changing the port status is not permitted.
      • setOutput

        public void setOutput​(boolean isOutput)
                       throws IllegalActionException
        Deprecated.
        Set whether or not this port is an output. In addition to the base class operation, set the port rate parameters to reasonable values. If setting the port to be an output, then set the consumption rate to be 1. If setting the port to not be an output, then set the consumption rate to be 0.
        Overrides:
        setOutput in class IOPort
        Parameters:
        isOutput - True to make the port an output.
        Throws:
        IllegalActionException - If changing the port status is not permitted.
      • setTokenConsumptionRate

        public void setTokenConsumptionRate​(int rate)
                                     throws IllegalActionException
        Deprecated.
        Set the number of tokens that are consumed on the appropriate port of this Actor during each firing by setting the value of the tokenConsumptionRate parameter.
        Parameters:
        rate - The number of tokens that are consumed
        Throws:
        IllegalActionException - If the rate is less than zero, or the port is not an input port.
        See Also:
        getTokenConsumptionRate()
      • setTokenInitProduction

        public void setTokenInitProduction​(int count)
                                    throws IllegalActionException
        Deprecated.
        Set the number of tokens that are produced on the appropriate port of this Actor during initialize by setting the value of the tokenInitProduction parameter.
        Parameters:
        count - The number of tokens that are produced
        Throws:
        IllegalActionException - If the count is less than zero, or the port is not an output port.
        See Also:
        getTokenInitProduction()
      • setTokenProductionRate

        public void setTokenProductionRate​(int rate)
                                    throws IllegalActionException
        Deprecated.
        Set the number of tokens that are produced on the appropriate port of this Actor during each firing by setting the value of the tokenProductionRate parameter.
        Parameters:
        rate - The number of tokens that are produced.
        Throws:
        IllegalActionException - If port is not contained in this actor, the rate is less than zero, or the port is not an output port.
        See Also:
        getTokenProductionRate()