|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.util.Attribute
ptolemy.actor.Director
ptolemy.actor.sched.StaticSchedulingDirector
ptolemy.domains.sdf.kernel.SDFDirector
ptolemy.domains.hdf.kernel.HDFDirector
public class HDFDirector
The Heterochronous Dataflow (HDF) domain is an extension of the Synchronous Dataflow (SDF) domain and implements the HDF model of computation [1]. In SDF, the set of port rates (called rate signatures) of an actor are constant. In HDF, however, rate signatures are allowed to change between iterations of the HDF schedule.
This director is often used with HDFFSMDirector. The HDFFSMDirector governs the execution of a modal model. The change of rate signatures can be modeled by state transitions of the modal model, in which each state refinement infers a set of rate signatures. Within each state, the HDF model behaves like an SDF model.
This director recomputes the schedules dynamically. To improve efficiency, this director uses a CachedSDFScheduler. A CachedSDFScheduler caches schedules labeled by their corresponding rate signatures, with the most recently used at the beginning of the queue. Therefore, when a state in HDF is revisited, the schedule identified by its rate signatures in the cache is used. We do not need to recompute the schedule.
The size of the cache in the CachedSDFScheduler is set by the scheduleCacheSize parameter of HDFDirector. The default value of this parameter is 100. If the cache is full, the least recently used schedule (at the end of the cache) is discarded.
References
HDFFSMDirector
,
CachedSDFScheduler
,
Serialized Form
Red (cxh) |
Red (zhouye) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
---|
NamedObj.ContainedObjectsIterator |
Field Summary | |
---|---|
Parameter |
scheduleCacheSize
A parameter representing the size of the schedule cache to use. |
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 | |
---|---|
HDFDirector()
Construct a director in the default workspace with an empty string as its name. |
|
HDFDirector(CompositeEntity container,
java.lang.String name)
Construct a director in the given container with the given name. |
|
HDFDirector(Workspace workspace)
Construct a director in the workspace with an empty name. |
Method Summary | |
---|---|
private void |
_init()
Initialize the object. |
void |
attributeChanged(Attribute attribute)
If the attribute changed is the scheduleCacheSize parameter, construct the cache in the associated CachedSDFScheduler with the given cache size. |
boolean |
postfire()
Send a request to the manager to get the HDF schedule if the schedule is not valid or this director is not at the top level. |
void |
preinitialize()
Preinitialize the actors associated with this director. |
void |
setScheduler(Scheduler scheduler)
Override the base class to ensure that the scheduler is an SDFScheduler and that its constrainBufferSizes parameter is set to false. |
Methods inherited from class ptolemy.domains.sdf.kernel.SDFDirector |
---|
clone, createSchedule, fireAt, getModelNextIterationTime, initialize, newReceiver, periodValue, prefire, suggestedModalModelDirectors, supportMultirateFiring, transferInputs, transferOutputs |
Methods inherited from class ptolemy.actor.sched.StaticSchedulingDirector |
---|
_setScheduler, addDebugListener, fire, getScheduler, invalidateSchedule, isScheduleValid, removeDebugListener |
Methods inherited from class ptolemy.kernel.util.Attribute |
---|
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent |
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 |
Field Detail |
---|
public Parameter scheduleCacheSize
Note that the number of schedules in an HDF model can be exponential in the number of actors. Setting the cache size to a very large value is therefore not recommended if the model contains a large number of HDF actors.
Constructor Detail |
---|
public HDFDirector() throws IllegalActionException, NameDuplicationException
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.public HDFDirector(Workspace workspace) throws IllegalActionException, NameDuplicationException
workspace
- The workspace for this object.
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.public HDFDirector(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- Container of the 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 is not a
CompositeActor and the name collides with an entity in the container.Method Detail |
---|
public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class SDFDirector
attribute
- The attribute that changed.
IllegalActionException
- If the super class throws it.public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class SDFDirector
IllegalActionException
- If no schedule can be found,
or if the super class method throws it.public void preinitialize() throws IllegalActionException
preinitialize
in interface Initializable
preinitialize
in class SDFDirector
IllegalActionException
- If the super class
preinitialize throws it.public void setScheduler(Scheduler scheduler) throws IllegalActionException, NameDuplicationException
setScheduler
in class StaticSchedulingDirector
scheduler
- The scheduler that this director will use.
IllegalActionException
- If the scheduler is not
an instance of SDFScheduler.
NameDuplicationException
- Not thrown in this base class,
but derived classes may throw it if the scheduler is not compatible.StaticSchedulingDirector.getScheduler()
private void _init() throws IllegalActionException, NameDuplicationException
IllegalActionException
NameDuplicationException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |