ptolemy.distributed.actor
Class DistributedDirector

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.util.Attribute
          extended by ptolemy.actor.Director
              extended by ptolemy.distributed.actor.DistributedDirector
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Executable, Initializable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

public class DistributedDirector
extends Director

The DistributedDirector extends Director to function on a distributed environment. It provides receivers of the type DistributedSDFReceiver. //TODO: Make it more generic that the type of receivers it provides can be changed in case different MoC are to be implemented.

Since:
Ptolemy II 5.1
Version:
$Id: DistributedDirector.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Daniel Lazaro Cuadrado (kapokasa@kom.aau.dk)
See Also:
Director, Serialized Form
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (kapokasa)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
private  java.util.HashMap idsReceiversMap
          Map from IDs to the receiver containing the ID.
private  int lastId
          Starting ID number for whenever a receiver is created and the list of IDs is empty.
private  java.util.LinkedList listOfIds
          List of IDs to assign no newly created receivers.
private  boolean VERBOSE
          When true depicts debugging messages.
 
Fields inherited from class ptolemy.actor.Director
_actorsFinishedExecution, _currentTime, _finishRequested, _initializables, _stopRequested, timeResolution
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
 
Constructor Summary
DistributedDirector()
          Construct a director in the default workspace with an empty string as its name.
DistributedDirector(CompositeEntity container, java.lang.String name)
          Construct a director in the given container with the given name.
DistributedDirector(Workspace workspace)
          Construct a director in the workspace with an empty name.
 
Method Summary
 java.util.HashMap getIdsReceiversMap()
          Return the map from ID to the receiver containing the ID.
 Receiver newReceiver()
          Return a DistributedSDFReceiver.
 void setListOfIds(java.util.LinkedList list)
          Specify the list of IDs to be used for Receiver creation by the newReceiver method.
 
Methods inherited from class ptolemy.actor.Director
_description, _fireContainerAt, _isEmbedded, _isTopLevel, _transferInputs, _transferOutputs, addInitializable, attributeChanged, createSchedule, defaultDependency, finish, fire, fireAt, fireAt, fireAtCurrentTime, getCausalityInterface, getCurrentTime, getErrorTolerance, getGlobalTime, getModelNextIterationTime, getModelStartTime, getModelStopTime, getModelTime, getNextIterationTime, getStartTime, getStopTime, getTimeResolution, implementsStrictActorSemantics, initialize, initialize, invalidateResolvedTypes, invalidateSchedule, isFireFunctional, isStopRequested, isStrict, iterate, postfire, prefire, preinitialize, preinitialize, removeInitializable, requestInitialization, setContainer, setCurrentTime, setModelTime, stop, stopFire, suggestedModalModelDirectors, supportMultirateFiring, terminate, transferInputs, transferOutputs, wrapup
 
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _exportMoMLContents, _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

listOfIds

private java.util.LinkedList listOfIds
List of IDs to assign no newly created receivers.


lastId

private int lastId
Starting ID number for whenever a receiver is created and the list of IDs is empty. This should never happen and it is meant for debugging purposes.


VERBOSE

private boolean VERBOSE
When true depicts debugging messages.


idsReceiversMap

private java.util.HashMap idsReceiversMap
Map from IDs to the receiver containing the ID.

Constructor Detail

DistributedDirector

public DistributedDirector()
Construct a director in the default workspace with an empty string as its name.


DistributedDirector

public DistributedDirector(Workspace workspace)
Construct a director in the workspace with an empty name.

Parameters:
workspace - The workspace of this object.

DistributedDirector

public DistributedDirector(CompositeEntity container,
                           java.lang.String name)
                    throws IllegalActionException,
                           NameDuplicationException
Construct a director in the given container with the given name. The container argument must not be null, or a NullPointerException will be thrown. If the name argument is null, then the name is set to the empty string.

Parameters:
container - The container.
name - The name of this director.
Throws:
IllegalActionException - If the name has a period in it, or the director is not compatible with the specified container, or if the time resolution parameter is malformed.
NameDuplicationException - If the container already contains an entity with the specified name.
Method Detail

getIdsReceiversMap

public java.util.HashMap getIdsReceiversMap()
Return the map from ID to the receiver containing the ID.

Returns:
A HashMap from ID to the receiver containing the ID.

newReceiver

public Receiver newReceiver()
Return a DistributedSDFReceiver. The receiver created will have the next available ID in the listOfIds that has been previously set. In case the listOfIds is empty, the ID will be a number starting from 1000 (lastID). This should never occur! It is there for testing purposes and could be removed.

Overrides:
newReceiver in class Director
Returns:
A DistributedSDFReceiver with the next available ID in the listOfIds.

setListOfIds

public void setListOfIds(java.util.LinkedList list)
Specify the list of IDs to be used for Receiver creation by the newReceiver method.

Parameters:
list - A list of IDs.