ptolemy.domains.dde.kernel
Class DDEActor

java.lang.Object
  extended byptolemy.kernel.util.NamedObj
      extended byptolemy.kernel.InstantiableNamedObj
          extended byptolemy.kernel.Entity
              extended byptolemy.kernel.ComponentEntity
                  extended byptolemy.actor.AtomicActor
                      extended byptolemy.actor.TypedAtomicActor
                          extended byptolemy.domains.dde.kernel.DDEActor
All Implemented Interfaces:
Actor, Changeable, java.lang.Cloneable, Debuggable, DebugListener, Derivable, Executable, Instantiable, ModelErrorHandler, MoMLExportable, Nameable, java.io.Serializable, TypedActor
Direct Known Subclasses:
FeedBackDelay, TimeAdvance

public class DDEActor
extends TypedAtomicActor

An optional base class for DDE actors. DDEActors are intended to execute as autonomous processes that maintain a distributed notion of time. In a DDE model, each actor is controlled by a unique DDEThread. Each DDEThread maintains its actor's local notion of time. Local time information is dependent on the time stamps associated with tokens that are consumed by an actor. More precisely, an actor's local notion of time is equivalent to the maximum time stamp of all tokens that the actor has consumed. Constraints on the consumption of tokens are described in the documentation for DDEThread. Note that consumed tokens may include NullTokens. A NullToken is a subclass of Token that is communicated solely for the purpose of advancing the local notion of time of the actor that consumes the NullToken.

The DDE model of computation supports typed, polymorphic actors and does not require this base class for implementation; this class is purely optional. This class provides convenient syntactic shortcuts for developing actors that operate according to DDE semantics.

Since:
Ptolemy II 0.3
Version:
$Id: DDEActor.java,v 1.34 2004/04/13 03:28:24 cxh Exp $
Author:
John S. Davis II
See Also:
DDEThread, NullToken, Serialized Form
Accepted Rating:
Yellow (yuhong)
Proposed Rating:
Yellow (davisj)

Nested Class Summary
 
Nested classes inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
 
Field Summary
 
Fields inherited from class ptolemy.actor.AtomicActor
_stopRequested
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
 
Constructor Summary
DDEActor()
          Construct a DDEActor with no container and a name that is an empty string.
DDEActor(CompositeEntity container, java.lang.String name)
          Construct a DDEActor with the specified container and name.
DDEActor(Workspace workspace)
          Construct a DDEActor with the specified workspace and a name that is an empty string.
 
Method Summary
 TypedIOPort getLastPort()
          Return the last port through which a token was consumed by this actor.
 Token getNextToken()
          Return a non-NullToken from the receiver that has the minimum, non-negative receiver time of all receivers contained by this actor.
 
Methods inherited from class ptolemy.actor.TypedAtomicActor
_addPort, attributeTypeChanged, clone, newPort, typeConstraintList
 
Methods inherited from class ptolemy.actor.AtomicActor
_createReceivers, clone, connectionsChanged, fire, getDirector, getExecutiveDirector, getFunctionDependency, getManager, initialize, inputPortList, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, pruneDependencies, removeDependency, setContainer, stop, stopFire, terminate, wrapup
 
Methods inherited from class ptolemy.kernel.ComponentEntity
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, propagateExistence, setName
 
Methods inherited from class ptolemy.kernel.Entity
_description, _exportMoMLContents, _removePort, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName, validateSettables
 
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ptolemy.actor.Actor
getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, newReceiver, outputPortList
 
Methods inherited from interface ptolemy.actor.Executable
fire, initialize, iterate, postfire, prefire, preinitialize, stop, stopFire, terminate, wrapup
 
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getFullName, getName, getName
 

Constructor Detail

DDEActor

public DDEActor()
Construct a DDEActor with no container and a name that is an empty string.


DDEActor

public DDEActor(Workspace workspace)
Construct a DDEActor with the specified workspace and a name that is an empty string.

Parameters:
workspace - The workspace for this DDEActor.

DDEActor

public DDEActor(CompositeEntity container,
                java.lang.String name)
         throws IllegalActionException,
                NameDuplicationException
Construct a DDEActor with the specified container and name. The name must be unique with respect to the container or an exception is thrown.

Parameters:
container - The container of this DDEActor.
name - The name of this DDEActor.
Throws:
IllegalActionException - If the constructor of the superclass throws an IllegalActionException.
NameDuplicationException - If the constructor of the superclass throws a NameDuplicationException .
Method Detail

getLastPort

public TypedIOPort getLastPort()
Return the last port through which a token was consumed by this actor. If no tokens have ever been consumed through any ports of this actor, then return null.

Returns:
TypedIOPort The last port through which a token was consumed by this actor.

getNextToken

public Token getNextToken()
                   throws IllegalActionException
Return a non-NullToken from the receiver that has the minimum, non-negative receiver time of all receivers contained by this actor. If there exists a set of multiple receivers that share a common minimum receiver time, then return the token contained by the highest priority receiver within this set. If this actor contains no receivers then return null. This method may block as it calls several blocking methods.

Returns:
Return a non-NullToken that has the minimum, nonnegative receiver time of all receivers contained by this actor.
Throws:
IllegalActionException