Package ptolemy.domains.hdf.kernel
Class HDFFSMDirector
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.actor.Director
-
- ptolemy.domains.modal.kernel.FSMDirector
-
- ptolemy.domains.modal.kernel.MultirateFSMDirector
-
- ptolemy.domains.hdf.kernel.HDFFSMDirector
-
- All Implemented Interfaces:
java.lang.Cloneable
,Executable
,Initializable
,QuasiTransparentDirector
,SuperdenseTimeDirector
,ExplicitChangeContext
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class HDFFSMDirector extends MultirateFSMDirector
This director extends MultirateFSMDirector by restricting that state transitions could only occur between global iterations. The choice and commitment of the transition is deferred by sending a change request to the manager.An HDFFSMDirector is often used in heterochronous dataflow (HDF) models. The HDF model of computation is a generalization of synchronous dataflow (SDF). In SDF, the set of port rates of an actor (called the rate signatures) are constant. In HDF, however, rate signatures are allowed to change between iterations of the HDF schedule. The change of rate signatures can be modeled by state transitions of a modal model, in which each state refinement infers a set of rate signatures.
References
- A. Girault, B. Lee, and E. A. Lee, `` Hierarchical Finite State Machines with Multiple Concurrency Models, '' April 13, 1998.
- Since:
- Ptolemy II 5.0
- Version:
- $Id$
- Author:
- Ye Zhou. Contributor: Brian K. Vogel
- See Also:
MultirateFSMDirector
,HDFDirector
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (zhouye)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
-
Fields inherited from class ptolemy.domains.modal.kernel.FSMDirector
_currentLocalReceiverMap, _indexOffset, _localReceiverMaps, controllerName
-
Fields inherited from class ptolemy.actor.Director
_actorsFinishedExecution, _aspectForActor, _aspectsPresent, _defaultMicrostep, _executionAspects, _finishRequested, _initializables, _nextScheduleTime, _stopRequested, _tokenSentToCommunicationAspect, _zeroTime, localClock, startTime, stopTime
-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _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
Constructors Constructor Description HDFFSMDirector(CompositeEntity container, java.lang.String name)
Construct a director in the given container with the given name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Entity
getContext()
Return the change context being made explicit.void
initialize()
Initialize the modal model.boolean
postfire()
Request a change of state transition to the manager.void
preinitialize()
Preinitialize the modal model.-
Methods inherited from class ptolemy.domains.modal.kernel.MultirateFSMDirector
_declareDependency, _declareReconfigurationDependencyForRefinementRateVariables, _doPostfire, _getEnclosingDomainActor, _getRefinementRateVariables, _setProductionConsumptionRates, _updateInputTokenConsumptionRates, _updateOutputTokenProductionRates, fire, fireAt, fireAtCurrentTime, newReceiver, supportMultirateFiring, transferInputs, transferOutputs
-
Methods inherited from class ptolemy.domains.modal.kernel.FSMDirector
_buildLocalReceiverMaps, _currentLocalReceivers, _getLastChosenTransition, _getStateRefinementsToPostfire, _getTransitionRefinementsToPostfire, _readInputs, _readOutputsFromRefinement, _setCurrentConnectionMap, _setCurrentState, _transferOutputs, attributeChanged, clone, defaultDependency, fireAt, getController, getIndex, getModelNextIterationTime, getModifiedVariables, getParseTreeEvaluator, handleModelError, implementsStrictActorSemantics, invalidateSchedule, isStrict, prefire, resetOutputReceivers, setContainer, setIndex
-
Methods inherited from class ptolemy.actor.Director
_actorFinished, _consultTimeRegulators, _description, _isEmbedded, _isTopLevel, _schedule, _transferInputs, addInitializable, createSchedule, delayDependency, elapsedTimeSinceStart, finish, fireAt, fireContainerAt, fireContainerAt, getCausalityInterface, getCurrentTime, getDeadline, getEnvironmentTime, getExecutionAspect, getGlobalTime, getModelStartTime, getModelStopTime, getModelTime, getNextIterationTime, getStartTime, getStopTime, getTimeResolution, initialize, invalidateResolvedTypes, isEmbedded, isFireFunctional, isStopRequested, iterate, mutexLockObject, notifyTokenSentToCommunicationAspect, preinitialize, removeInitializable, requestInitialization, resume, resumeActor, scheduleContainedActors, setCurrentTime, setEmbedded, setModelTime, setTimeResolution, stop, stopFire, suggestedModalModelDirectors, suspend, terminate, transferOutputs, 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, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, 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, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, 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.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
-
-
-
-
Constructor Detail
-
HDFFSMDirector
public HDFFSMDirector(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.- Parameters:
container
- Container of the director.name
- Name of this director.- Throws:
IllegalActionException
- If the name has a period in it, or the director is not compatible with the specified container.NameDuplicationException
- If the container is not a CompositeActor and the name collides with an entity in the container.
-
-
Method Detail
-
getContext
public Entity getContext()
Return the change context being made explicit. This class overrides the implementation in the FSMDirector base class to report that modal models using HDFFSMDirector only make state transitions between toplevel iterations.- Specified by:
getContext
in interfaceExplicitChangeContext
- Overrides:
getContext
in classFSMDirector
- Returns:
- The explicit change context.
-
initialize
public void initialize() throws IllegalActionException
Initialize the modal model. Set the _sendRequest flag to be true to indicate the modal model can send a change request to the manager. Set the controller flag to indicate a new iteration begins.- Specified by:
initialize
in interfaceInitializable
- Overrides:
initialize
in classMultirateFSMDirector
- Throws:
IllegalActionException
- If the base class throws it.
-
postfire
public boolean postfire() throws IllegalActionException
Request a change of state transition to the manager.- Specified by:
postfire
in interfaceExecutable
- Overrides:
postfire
in classMultirateFSMDirector
- Returns:
- True if the postfire of the current state refinement returns true.
- Throws:
IllegalActionException
- If a refinement throws it, if there is no controller.
-
preinitialize
public void preinitialize() throws IllegalActionException
Preinitialize the modal model. Set the _sendRequest flag to be true to indicate the modal model can send a change request to the manager.- Specified by:
preinitialize
in interfaceInitializable
- Overrides:
preinitialize
in classMultirateFSMDirector
- Throws:
IllegalActionException
- If there is no controller, or if the non-transient initial state has no or more than one refinement, or if the preinitialize() method of one of the associated actors throws it.
-
-