|
||||||||||
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.sched.StaticSchedulingDirector
ptolemy.actor.sched.FixedPointDirector
ptolemy.actor.kiel.SyncChartDirector
public class SyncChartDirector
This director implements a fixed point iteration for finding synchronous signal assignments of SyncCharts. This director is based on the FixedPointDirector that was written for Ptolemy II by Haiyang Zheng and Edward A. Lee.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
---|
ptolemy.kernel.util.NamedObj.ContainedObjectsIterator |
Field Summary | |
---|---|
protected int |
_index
The current index of the model. |
protected List |
_receivers
List of all receivers this director has created. |
ptolemy.kernel.util.Attribute |
statesignals
|
Fields inherited from class ptolemy.actor.sched.FixedPointDirector |
---|
iterations, synchronizeToRealTime |
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 | |
---|---|
SyncChartDirector()
Construct a director in the default workspace with an empty string as its name. |
|
SyncChartDirector(ptolemy.kernel.CompositeEntity container,
String name)
Construct a director in the given container with the given name. |
|
SyncChartDirector(ptolemy.kernel.util.Workspace workspace)
Construct a director in the given workspace with an empty name. |
Method Summary | |
---|---|
protected void |
_receiverChanged()
React to the change in receiver status by incrementing the count of known receivers. |
protected void |
_resetAllReceivers()
Reset all receivers to unknown status and clear out variables used to track which actors fired in the last iteration. |
protected void |
_synchronizeToRealTime()
Synchronize to real time, if appropriate. |
void |
fire()
Prefire and fire actors in the order given by the scheduler until the iteration converges. |
int |
getIndex()
Return the current index of the director. |
String[] |
getMustCannotSignals()
Specify whether the execution should synchronize to the real time. |
boolean |
implementsStrictActorSemantics()
Return true, indicating that this director assumes and exports the strict actor semantics, as described in this paper: |
void |
initialize()
Initialize the director and all deeply contained actors by calling the super.initialize() method. |
boolean |
isFireFunctional()
Return true if all the controlled actors' isFireFunctional() methods return true. |
boolean |
isPossiblyEnabled(ptolemy.domains.modal.kernel.Transition transition)
Checks whether a transition can possibly be taken. |
boolean |
isStrict()
Return false. |
ptolemy.actor.Receiver |
newReceiver()
Return a new FixedPointReceiver. |
boolean |
postfire()
Call postfire() on all contained actors that were fired in the current iteration. |
boolean |
prefire()
Return true if the director is ready to fire. |
void |
setIndex(int index)
Set the superdense time index. |
String[] |
suggestedModalModelDirectors()
Return an array of suggested directors to be used with ModalModel. |
boolean |
transferInputs(ptolemy.actor.IOPort port)
Transfer data from the specified input port of the container to the ports it is connected to on the inside. |
boolean |
transferOutputs(ptolemy.actor.IOPort port)
Transfer data from the specified output port of the container to the ports it is connected to on the outside. |
Methods inherited from class ptolemy.actor.sched.StaticSchedulingDirector |
---|
_setScheduler, addDebugListener, clone, getScheduler, invalidateSchedule, isScheduleValid, removeDebugListener, setScheduler |
Methods inherited from class ptolemy.actor.Director |
---|
_description, _fireContainerAt, _getWCET, _isEmbedded, _isTopLevel, _transferInputs, _transferOutputs, addInitializable, attributeChanged, createSchedule, defaultDependency, finish, fireAt, fireAt, fireAtCurrentTime, getCausalityInterface, getCurrentTime, getErrorTolerance, getGlobalTime, getModelNextIterationTime, getModelStartTime, getModelStopTime, getModelTime, getNextIterationTime, getStartTime, getStopTime, getTimeResolution, initialize, invalidateResolvedTypes, isStopRequested, iterate, preinitialize, removeInitializable, requestInitialization, setContainer, setCurrentTime, setModelTime, stop, stopFire, supportMultirateFiring, 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 |
Field Detail |
---|
public ptolemy.kernel.util.Attribute statesignals
protected int _index
protected List _receivers
Constructor Detail |
---|
public SyncChartDirector() throws ptolemy.kernel.util.IllegalActionException, ptolemy.kernel.util.NameDuplicationException
ptolemy.kernel.util.IllegalActionException
- If the name has a period in it, or
the director is not compatible with the specified container.
ptolemy.kernel.util.NameDuplicationException
- If the container already contains
an entity with the specified name.public SyncChartDirector(ptolemy.kernel.util.Workspace workspace) throws ptolemy.kernel.util.IllegalActionException, ptolemy.kernel.util.NameDuplicationException
workspace
- The workspace for this object.
ptolemy.kernel.util.IllegalActionException
- If the name has a period in it, or
the director is not compatible with the specified container.
ptolemy.kernel.util.NameDuplicationException
- If the container already contains
an entity with the specified name.public SyncChartDirector(ptolemy.kernel.CompositeEntity container, String name) throws ptolemy.kernel.util.IllegalActionException, ptolemy.kernel.util.NameDuplicationException
container
- Container of the director.name
- Name of this director.
ptolemy.kernel.util.IllegalActionException
- If the director is not compatible
with the specified container.
ptolemy.kernel.util.NameDuplicationException
- If the name collides with an
attribute in the container.Method Detail |
---|
public boolean isPossiblyEnabled(ptolemy.domains.modal.kernel.Transition transition) throws ptolemy.kernel.util.IllegalActionException
transition
- the transition
ptolemy.kernel.util.IllegalActionException
- the illegal action exceptionpublic String[] getMustCannotSignals()
public void fire() throws ptolemy.kernel.util.IllegalActionException
fire
in interface ptolemy.actor.Executable
fire
in class ptolemy.actor.sched.FixedPointDirector
ptolemy.kernel.util.IllegalActionException
- If an actor violates the
monotonicity constraints, or the prefire() or fire() method
of the actor throws it.public int getIndex()
getIndex
in interface ptolemy.actor.SuperdenseTimeDirector
getIndex
in class ptolemy.actor.sched.FixedPointDirector
setIndex(int)
,
SuperdenseTimeDirector
public boolean implementsStrictActorSemantics()
A. Goderis, C. Brooks, I. Altintas, E. A. Lee, and C. Goble, "Heterogeneous Composition of Models of Computation," EECS Department, University of California, Berkeley, Tech. Rep. UCB/EECS-2007-139, Nov. 2007. http://www.eecs.berkeley.edu/Pubs/TechRpts/2007/EECS-2007-139.html
In particular, a director that implements this interface guarantees that it will not invoke the postfire() method of an actor until all its inputs are known at the current tag. Moreover, it it will only do so in its own postfire() method, and in its prefire() and fire() methods, it does not change its own state. Thus, such a director can be used within a model of computation that has a fixed-point semantics, such as SRDirector and ContinuousDirector.
implementsStrictActorSemantics
in class ptolemy.actor.sched.FixedPointDirector
public void initialize() throws ptolemy.kernel.util.IllegalActionException
initialize
in interface ptolemy.actor.Initializable
initialize
in class ptolemy.actor.sched.FixedPointDirector
ptolemy.kernel.util.IllegalActionException
- If the superclass throws it.public boolean isFireFunctional()
isFireFunctional
in interface ptolemy.actor.Executable
isFireFunctional
in class ptolemy.actor.sched.FixedPointDirector
public boolean isStrict()
isStrict
in interface ptolemy.actor.Executable
isStrict
in class ptolemy.actor.sched.FixedPointDirector
public ptolemy.actor.Receiver newReceiver()
newReceiver
in class ptolemy.actor.sched.FixedPointDirector
public boolean postfire() throws ptolemy.kernel.util.IllegalActionException
postfire
in interface ptolemy.actor.Executable
postfire
in class ptolemy.actor.sched.FixedPointDirector
ptolemy.kernel.util.IllegalActionException
- If the iterations parameter does
not have a valid token, or if there still some unknown inputs (which
indicates a causality loop).public boolean prefire() throws ptolemy.kernel.util.IllegalActionException
prefire
in interface ptolemy.actor.Executable
prefire
in class ptolemy.actor.sched.FixedPointDirector
ptolemy.kernel.util.IllegalActionException
- Not thrown in this base class.public void setIndex(int index) throws ptolemy.kernel.util.IllegalActionException
setIndex
in interface ptolemy.actor.SuperdenseTimeDirector
setIndex
in class ptolemy.actor.sched.FixedPointDirector
ptolemy.kernel.util.IllegalActionException
- Not thrown in this base class.getIndex()
,
SuperdenseTimeDirector
public String[] suggestedModalModelDirectors()
suggestedModalModelDirectors
in class ptolemy.actor.sched.FixedPointDirector
Director.suggestedModalModelDirectors()
public boolean transferInputs(ptolemy.actor.IOPort port) throws ptolemy.kernel.util.IllegalActionException
transferInputs
in class ptolemy.actor.sched.FixedPointDirector
port
- The port to transfer tokens from.
ptolemy.kernel.util.IllegalActionException
- If the port is not an opaque
input port.public boolean transferOutputs(ptolemy.actor.IOPort port) throws ptolemy.kernel.util.IllegalActionException
transferOutputs
in class ptolemy.actor.sched.FixedPointDirector
port
- The port to transfer tokens from.
ptolemy.kernel.util.IllegalActionException
- If the port is not an opaque
output port.protected void _receiverChanged()
_receiverChanged
in class ptolemy.actor.sched.FixedPointDirector
protected void _resetAllReceivers()
_resetAllReceivers
in class ptolemy.actor.sched.FixedPointDirector
protected void _synchronizeToRealTime() throws ptolemy.kernel.util.IllegalActionException
_synchronizeToRealTime
in class ptolemy.actor.sched.FixedPointDirector
ptolemy.kernel.util.IllegalActionException
- If the synchronizeToRealTime
parameter is ill formed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |