|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.util.Attribute
ptolemy.actor.Director
ptolemy.actor.process.ProcessDirector
ptolemy.actor.process.CompositeProcessDirector
ptolemy.domains.dde.kernel.DDEDirector
A DDEDirector governs the execution of actors operating according to the DDE model of computation (MoC). The DDE MoC incorporates a distributed notion of time into a dataflow style communication semantic. Blocking reads occur if attempts to consume data are made when the corresponding receiver is empty and blocking writes occur if attempts to produce data are made when the corresponding receiver is full.
In conjunction with the blocking read/write facilities, the DDE domain uses a distributed, local notion of time. In a network of actors governed by a DDEDirector each actor has a local notion of time. Several features of the DDEDirector are intended to facilitate these local notions of time.
All DDE models have a completion time. The completion time is a preset time after which all execution ceases. The completion time for a DDEDirector is specified via the stopTime parameter. The value of the stopTime parameter is passed to the receivers of all actors that the DDEDirector governs via newReceiver() during initialize(). After initialize() has been called, the value of stopTime can not be changed.
The default value of the stopTime parameter is PrioritizedTimedQueue.ETERNITY. Given this value, a DDE model will continue executing without regard for a completion time.
Deadlock due to feedback loops is dealt with via NullTokens. When an actor in a DDE model receives a NullToken, it may advance its local time value even though no computation results directly from consumption of the NullToken. For models with feedback topologies, the FeedBackDelay actor should be used in the feedback loop.
The DDE model of computation assumes that valid time stamps have non-negative values. Three special purpose negative time values are reserved with the following meanings. The value of PrioritizedTimedQueue.INACTIVE is reserved to indicate the termination of a receiver. The value of PrioritizedTimedQueue.ETERNITY is reserved to indicate that a receiver has not begun to participate in a model's execution. The value of PrioritizedTimedQueue.IGNORE is reserved to indicate that the current token at the head of a DDEReceiver should be ignored in favor of the tokens contained in the other receivers of the actor in question. More details of IGNORE can be found in FeedBackDelay.
NOTE: The current implementation of this director does not include an infrastructure for mutations. Hence, ChangeRequest and other facilities for changing the topology of a model are not included in this director.
PNDirector,
FeedBackDelay,
NullToken,
Serialized Form
| Red (cxh) |
| Red (davisj) |
| Nested Class Summary |
| Nested classes inherited from class ptolemy.kernel.util.NamedObj |
NamedObj.ContainedObjectsIterator |
| Field Summary | |
Parameter |
stopTime
The stopTime parameter specifies the completion time of a model's execution. |
| Fields inherited from class ptolemy.actor.process.ProcessDirector |
_notDone |
| Fields inherited from class ptolemy.actor.Director |
_currentTime, _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 | |
DDEDirector()
Construct a DDEDirector in the default workspace with an empty string as its name. |
|
DDEDirector(CompositeEntity container,
java.lang.String name)
Construct a director in the given container with the given name. |
|
DDEDirector(Workspace workspace)
Construct a director in the workspace with an empty string as a name. |
|
| Method Summary | |
protected void |
_actorBlocked(java.util.LinkedList receivers)
Register the receivers that instigated the newly blocked actor. |
protected void |
_actorBlocked(ProcessReceiver receiver)
Register the receiver that instigated the newly blocked actor and increment the count of blocked actors by one. |
protected void |
_actorUnBlocked(DDEReceiver receiver)
Unregister the specified receiver that was previously blocked and decrement the count of blocked actors by one. |
protected void |
_actorUnBlocked(java.util.LinkedList receivers)
Call _actorsUnblocked(DDEReceivers) on each element of the list. |
protected ProcessThread |
_getProcessThread(Actor actor,
ProcessDirector director)
Return a new ProcessThread of a type compatible with this director. |
protected void |
_incrementLowestCapacityPort()
Increment the port capacity's according to Tom Parks' algorithm. |
protected boolean |
_resolveInternalDeadlock()
Apply an algorithm to resolve an internal deadlock and return true if the algorithm is successful. |
void |
fireAt(Actor actor,
double time)
Schedule an actor to be fired at the specified time. |
double |
getCurrentTime()
Return the current time of the DDEThread that calls this method on behalf of an actor. |
boolean |
hasMutation()
Return false indicating that none of the actors governed by this director have a mutation. |
void |
initialize()
Initialize this director and the actors it contains and set variables to their initial values. |
Receiver |
newReceiver()
Return a new receiver of a type compatible with this director. |
boolean |
postfire()
Return true if the actors governed by this director can continue execution, and false otherwise. |
| Methods inherited from class ptolemy.actor.process.ProcessDirector |
_actorHasRestarted, _actorHasStopped, _addNewThread, _areAllActorsStopped, _decreaseActiveCount, _getActiveActorsCount, _getBlockedActorsCount, _getStoppedActorsCount, _increaseActiveCount, fire, initialize, isStopFireRequested, isStopRequested, preinitialize, stop, stopFire, terminate, transferInputs, transferOutputs |
| Methods inherited from class ptolemy.kernel.util.Attribute |
_getContainedObject, _propagateExistence, getContainer, setName |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public Parameter stopTime
| Constructor Detail |
public DDEDirector()
throws IllegalActionException,
NameDuplicationException
public DDEDirector(Workspace workspace)
throws IllegalActionException,
NameDuplicationException
workspace - The workspace of this object.
public DDEDirector(CompositeEntity container,
java.lang.String name)
throws IllegalActionException,
NameDuplicationException
container - The container of this director.name - Name of this director.
IllegalActionException - If the director is not compatible
with the specified container. May be thrown in a derived class.
NameDuplicationException - If the container not a
CompositeActor and the name collides with an entity in the container.| Method Detail |
public double getCurrentTime()
getCurrentTime in class Director
public void fireAt(Actor actor,
double time)
throws IllegalActionException
NOTE: The current implementation of this method is such that a more appropriate name might be continueAt() rather than fireAt().
fireAt in class Directoractor - The actor scheduled to fire.time - The scheduled time to fire.
IllegalActionException - If the specified
time is in the past or if the thread calling this
method is a DDEThread but the specified actor is
not contained by the DDEThread.public boolean hasMutation()
public void initialize()
throws IllegalActionException
initialize in interface Executableinitialize in class CompositeProcessDirectorIllegalActionException - If there is an
error during the creation of the threads or
initialization of the actors.public Receiver newReceiver()
newReceiver in class CompositeProcessDirector
public boolean postfire()
throws IllegalActionException
postfire in interface Executablepostfire in class ProcessDirectorIllegalActionException - Not thrown in this base class.
May be thrown in derived classes.protected void _actorBlocked(ProcessReceiver receiver)
_actorBlocked in class CompositeProcessDirectorreceiver - The receiver whose data transfer is blocked.protected void _actorBlocked(java.util.LinkedList receivers)
_actorBlocked in class CompositeProcessDirectorreceivers - The receivers whose data transfer is blocked.protected void _actorUnBlocked(java.util.LinkedList receivers)
_actorUnBlocked in class CompositeProcessDirectorreceivers - A list of DDEReceivers to unblock.protected void _actorUnBlocked(DDEReceiver receiver)
receiver - The receiver whose data transfer was
previously blocked.
protected ProcessThread _getProcessThread(Actor actor,
ProcessDirector director)
throws IllegalActionException
_getProcessThread in class ProcessDirectoractor - The actor that the new ProcessThread will
control.director - The director that manages the new
ProcessThread.
IllegalActionException - If an error occurs while
instantiating the new ProcessThread.
protected void _incrementLowestCapacityPort()
throws IllegalActionException
IllegalActionException - If there is an error
while attempting to set the capacity of a DDE receiver.
protected boolean _resolveInternalDeadlock()
throws IllegalActionException
_resolveInternalDeadlock in class CompositeProcessDirectorIllegalActionException - Not thrown in this base class.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||