ptolemy.domains.psdf.kernel
Class PSDFDirector

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.util.Attribute
          extended by ptolemy.actor.Director
              extended by ptolemy.actor.sched.StaticSchedulingDirector
                  extended by ptolemy.domains.sdf.kernel.SDFDirector
                      extended by ptolemy.domains.psdf.kernel.PSDFDirector
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Executable, Initializable, PeriodicDirector, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

public class PSDFDirector
extends SDFDirector

The Parameterized Synchronous Dataflow (PSDF) domain is an extension of the Synchronous Dataflow (SDF) domain that allows for more extensive reconfiguration of models. The SDF domain uses static analysis of variable dependence to detect cases where rate parameters may change. By default, SDF disallows reconfiguration of all rate parameters. If rate parameters are allowed to change, then SDF checks that rate parameters do not change during execution of the schedule, and declares that inferred rate parameters for external ports change as often as the internal rate parameters.

This domain offers two key extensions:

  1. Dependence analysis is used to determine if the modification to the rate parameters occurs during execution of the SDF schedule. If this test passes, then a parameterized schedule is constructed.
  2. The generated schedule is checked for local synchrony, to determine if external rate parameters may change. The correct dependency information for external ports is then declared.
Note that the resulting behavior is identical to the SDF scheduler, with rate parameter changes allowed, except much more efficient, since scheduling on the fly is not necessary during every reconfiguration. Additionally, code can be generated for the PSDF domain that allows for efficient reconfiguration. The added precision of dependency analysis for external rate parameters also means that some hierarchical models that would be ruled out by the SDF checks are allowed.

Since:
Ptolemy II 3.1
Version:
$Id: PSDFDirector.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Steve Neuendorffer
See Also:
PSDFScheduler, Serialized Form
Accepted Rating:
Red (johnr)
Proposed Rating:
Red (neuendor)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
 
Fields inherited from class ptolemy.domains.sdf.kernel.SDFDirector
_iterationCount, _periodicDirectorHelper, allowDisconnectedGraphs, allowRateChanges, constrainBufferSizes, iterations, period, synchronizeToRealTime, vectorizationFactor
 
Fields inherited from class ptolemy.actor.sched.StaticSchedulingDirector
_postfireReturns
 
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
PSDFDirector()
          Construct a director in the default workspace with an empty string as its name.
PSDFDirector(CompositeEntity container, java.lang.String name)
          Construct a director in the given container with the given name.
PSDFDirector(Workspace workspace)
          Construct a director in the workspace with an empty name.
 
Method Summary
private  void _init()
          Initialize the object.
 void invalidateSchedule()
          Indicate that a schedule for the model may no longer be valid.
 
Methods inherited from class ptolemy.domains.sdf.kernel.SDFDirector
attributeChanged, clone, createSchedule, fireAt, getModelNextIterationTime, initialize, newReceiver, periodValue, postfire, prefire, preinitialize, suggestedModalModelDirectors, supportMultirateFiring, transferInputs, transferOutputs
 
Methods inherited from class ptolemy.actor.sched.StaticSchedulingDirector
_setScheduler, addDebugListener, fire, getScheduler, isScheduleValid, removeDebugListener, setScheduler
 
Methods inherited from class ptolemy.actor.Director
_description, _fireContainerAt, _isEmbedded, _isTopLevel, _transferInputs, _transferOutputs, addInitializable, defaultDependency, finish, fireAt, fireAtCurrentTime, getCausalityInterface, getCurrentTime, getErrorTolerance, getGlobalTime, getModelStartTime, getModelStopTime, getModelTime, getNextIterationTime, getStartTime, getStopTime, getTimeResolution, implementsStrictActorSemantics, initialize, invalidateResolvedTypes, isFireFunctional, isStopRequested, isStrict, iterate, preinitialize, removeInitializable, requestInitialization, setContainer, setCurrentTime, setModelTime, stop, stopFire, terminate, wrapup
 
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, 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, 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, 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
 
Methods inherited from interface ptolemy.actor.Executable
fire, isFireFunctional, isStrict, iterate, stop, stopFire, terminate
 
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, removeInitializable, wrapup
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
 

Constructor Detail

PSDFDirector

public PSDFDirector()
             throws IllegalActionException,
                    NameDuplicationException
Construct a director in the default workspace with an empty string as its name. The director is added to the list of objects in the workspace. Increment the version number of the workspace. The PSDFDirector will have a default scheduler of type PDFScheduler.

Throws:
IllegalActionException - If the name has a period in it, or the director is not compatible with the specified container.
NameDuplicationException - If the container already contains an entity with the specified name.

PSDFDirector

public PSDFDirector(Workspace workspace)
             throws IllegalActionException,
                    NameDuplicationException
Construct a director in the workspace with an empty name. The director is added to the list of objects in the workspace. Increment the version number of the workspace. The PSDFDirector will have a default scheduler of type PDFScheduler.

Parameters:
workspace - The workspace for this object.
Throws:
IllegalActionException - If the name has a period in it, or the director is not compatible with the specified container.
NameDuplicationException - If the container already contains an entity with the specified name.

PSDFDirector

public PSDFDirector(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. Increment the version number of the workspace. The PSDFDirector will have a default scheduler of type PSDFScheduler.

Parameters:
container - Container of the director.
name - Name of this director.
Throws:
IllegalActionException - If the director is not compatible with the specified container. May be thrown in a derived class.
NameDuplicationException - If the container is not a CompositeActor and the name collides with an entity in the container.
Method Detail

invalidateSchedule

public void invalidateSchedule()
Indicate that a schedule for the model may no longer be valid. This method should be called when topology changes are made, or for that matter when any change that may invalidate the schedule is made. In this base class, this method sets a flag that forces scheduling to be redone at the next opportunity. If there is no scheduler, do nothing.

Overrides:
invalidateSchedule in class StaticSchedulingDirector

_init

private void _init()
            throws IllegalActionException,
                   NameDuplicationException
Initialize the object. In this case, we give the PSDFDirector a default scheduler of the class PSDFScheduler.

Throws:
IllegalActionException
NameDuplicationException