ptolemy.domains.sdf.kernel
Class SDFIOPort

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.Port
          extended by ptolemy.kernel.ComponentPort
              extended by ptolemy.actor.IOPort
                  extended by ptolemy.actor.TypedIOPort
                      extended by ptolemy.domains.sdf.kernel.SDFIOPort
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, HasTypeConstraints, Typeable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

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.

public final class SDFIOPort
extends TypedIOPort

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: SDFIOPort.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Stephen Neuendorffer
See Also:
Serialized Form
Accepted Rating:
Yellow (johnr)
Proposed Rating:
Yellow (neuendor)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
 Parameter tokenConsumptionRate
          Deprecated. The number of tokens consumed on this port each firing.
 Parameter tokenInitProduction
          Deprecated. The number of tokens produced on this port during initialization.
 Parameter tokenProductionRate
          Deprecated. The number of tokens produced on this port each firing.
 
Fields inherited from class ptolemy.actor.TypedIOPort
TYPE
 
Fields inherited from class ptolemy.actor.IOPort
_hasPortEventListeners, _portEventListeners, CONFIGURATION, RECEIVERS, REMOTERECEIVERS
 
Fields inherited from class ptolemy.kernel.Port
_insideLinks, _relationsList
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
SDFIOPort()
          Deprecated. Construct an SDFIOPort with no container and no name that is neither an input nor an output.
SDFIOPort(ComponentEntity container, java.lang.String name)
          Deprecated. Construct an SDFIOPort with a containing actor and a name that is neither an input nor an output.
SDFIOPort(ComponentEntity container, java.lang.String name, boolean isInput, boolean isOutput)
          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.
SDFIOPort(Workspace workspace)
          Deprecated. Construct a port in the specified workspace with an empty string as a name.
 
Method Summary
private  void _initialize()
          Deprecated. Initialize local data members.
 java.lang.Object clone(Workspace workspace)
          Deprecated. Clone the port into the specified workspace.
 int getTokenConsumptionRate()
          Deprecated. Get the number of tokens that are consumed on every channel of this port.
 int getTokenInitProduction()
          Deprecated. Get the number of tokens that are produced on this port during initialization.
 int getTokenProductionRate()
          Deprecated. Get the number of tokens that are produced on the designated port of this Actor during each firing.
 void setInput(boolean isInput)
          Deprecated. Set whether or not this port is an input.
 void setOutput(boolean isOutput)
          Deprecated. Set whether or not this port is an output.
 void setTokenConsumptionRate(int rate)
          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.
 void setTokenInitProduction(int count)
          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.
 void setTokenProductionRate(int rate)
          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.
 
Methods inherited from class ptolemy.actor.TypedIOPort
_checkContainer, _checkLiberalLink, _checkLink, _checkType, _description, addTypeListener, attributeChanged, broadcast, broadcast, convert, getType, getTypeTerm, isTypeAcceptable, removeTypeListener, send, send, sendInside, setTypeAtLeast, setTypeAtLeast, setTypeAtMost, setTypeEquals, setTypeSameAs, typeConstraintList, typeConstraints
 
Methods inherited from class ptolemy.actor.IOPort
_checkLiberalLink, _exportMoMLContents, _getInsideWidth, _getOutsideWidth, _getReceiversLinkedToGroup, _newInsideReceiver, _newReceiver, _notifyPortEventListeners, _removeReceivers, addIOPortEventListener, broadcastClear, checkWidthConstraints, createReceivers, deepConnectedInPortList, deepConnectedInPorts, deepConnectedOutPortList, deepConnectedOutPorts, deepGetReceivers, get, get, getChannelForReceiver, getCurrentTime, getDefaultWidth, getInside, getInsideReceivers, getModelTime, getReceivers, getReceivers, getReceivers, getRelationIndex, getRemoteReceivers, getRemoteReceivers, getWidth, getWidthFromConstraints, getWidthInside, hasRoom, hasRoomInside, hasToken, hasToken, hasTokenInside, hasWidthConstraints, insertLink, insideSinkPortList, insideSourcePortList, isInput, isInsideConnected, isKnown, isKnown, isKnownInside, isMultiport, isOutput, isOutsideConnected, liberalLink, link, numberOfSinks, numberOfSources, removeIOPortEventListener, sendClear, sendClearInside, setContainer, setDefaultWidth, setMultiport, setWidthEquals, setWidthEquals, sinkPortList, sourcePortList, transferInputs, transferOutputs, unlink, unlink, unlinkAll, unlinkAllInside, unlinkInside, unlinkInside
 
Methods inherited from class ptolemy.kernel.ComponentPort
_deepConnectedPortList, _deepConnectedPorts, _deepInsidePortList, _deepInsidePorts, _isInsideLinkable, deepConnectedPortList, deepConnectedPorts, deepInsidePortList, deepInsidePorts, insertInsideLink, insidePortList, insidePorts, insideRelationList, insideRelations, isDeeplyConnected, isInsideGroupLinked, isInsideLinked, isOpaque, numInsideLinks
 
Methods inherited from class ptolemy.kernel.Port
_getContainedObject, _propagateExistence, connectedPortList, connectedPorts, getContainer, isGroupLinked, isLinked, linkedRelationList, linkedRelations, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, numLinks, setName
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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)
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.

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()

_initialize

private void _initialize()
Deprecated. 
Initialize local data members.