public class PthalesDirector extends SDFDirector
This is based on Array-OL, as described by:
A more detailed documentation of the Pthales domain can be found in a technical report currently under preparation and accessible at:
The notation used here is intended to follow the spirit of SpearDE [FIXME: Reference?], from Thales, a software system based on Array-OL. In this notation, unlike Boulet's, dimensions are named, and patterns for reading and writing arrays are given using those names.
[FIXME: the description that follows needs update, the contents and syntax of parameter specs have changed] [FIXME: it seems mostly OK to me (Stavros): I made a mild pass. Please check] The execution is governed by the following parameters in the model. In all cases except for the "repetitions" parameter, the parameters are OrderedRecords of the form "[x = n, y = m, ...]", where x and y are arbitrary dimension names and n and m are non-negative integers. For parameters that supports strides (such as the "pattern" parameter), n and m can be replaced by {n,s} or {m,s}, where s is the stride (a positive integer). The stride defaults to 1 if not specified. Unless otherwise stated, the parameters do not support strides. Ports contain the following parameters:
x | y | value |
0 | 0 | 1 |
1 | 0 | 2 |
2 | 0 | 3 |
0 | 1 | 4 |
1 | 1 | 5 |
2 | 1 | 6 |
x | y | value |
0 | 0 | 1 |
0 | 1 | 2 |
1 | 0 | 3 |
1 | 1 | 4 |
2 | 0 | 5 |
2 | 1 | 6 |
In all cases, when indexes are incremented, they are incremented in a toroidal fashion, wrapping around when they reach the size of the array. Thus, it is always possible (though rarely useful) for an array size to be 1 in every dimension. [FIXME?]
NOTE: It should be possible to define a PtalesPort and PtalesCompositeActor that contain the above parameters, as a convenience. These could be put in a library.
NOTE: It should be possible to create a single interface for this director so that when double clicked, it brings up an interactive dialog that has the form of a Spear table. It would have one row per port, plus a header row to specify the iterations.
FIXME: Need to export production and consumption data for SDF, allowing these Pthales models to be nested within SDF or within Pthales, which will also allow it to be nested within modal models.
Red (cxh) |
Red (cxh) |
NamedObj.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
protected StringParameter |
_library
Buffer memory.
|
_iterationCount, _periodicDirectorHelper, allowDisconnectedGraphs, allowRateChanges, AUTO_INTTOKEN, AUTO_NAME, constrainBufferSizes, iterations, ITERATIONS_NAME, period, synchronizeToRealTime, UNBOUNDED_INTTOKEN, UNBOUNDED_NAME, vectorizationFactor
_postfireReturns, _prefire
_actorsFinishedExecution, _aspectForActor, _aspectsPresent, _defaultMicrostep, _executionAspects, _finishRequested, _initializables, _nextScheduleTime, _stopRequested, _tokenSentToCommunicationAspect, _zeroTime, localClock, startTime, stopTime
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
PthalesDirector(CompositeEntity container,
java.lang.String name)
Constructs a PthalesDirector object, using PthalesScheduler.
|
Modifier and Type | Method and Description |
---|---|
void |
attributeChanged(Attribute attribute)
Attribute update.
|
java.lang.Object |
clone(Workspace workspace)
Clone the object into the specified workspace.
|
void |
fire()
Calculate the current schedule, if necessary, and iterate the
contained actors in the order given by the schedule.
|
java.lang.String |
getLibName()
Get the name of the library to use.
|
Receiver |
newReceiver()
Add a new receiver.
|
boolean |
prefire()
Return true if the director is ready to fire.
|
void |
preinitialize()
Preinitialize the actors associated with this director and
compute the schedule.
|
boolean |
transferInputs(IOPort port)
Override the base class method to transfer enough tokens to
complete an internal iteration.
|
boolean |
transferOutputs(IOPort port)
Override the base class method to transfer enough tokens to
fulfill the output production rate.
|
createSchedule, fireAt, getIterations, getModelNextIterationTime, initialize, periodValue, postfire, suggestedModalModelDirectors, supportMultirateFiring
_setScheduler, addDebugListener, getScheduler, invalidateSchedule, isScheduleValid, removeDebugListener, resumeActor, setScheduler
_actorFinished, _consultTimeRegulators, _description, _isEmbedded, _isTopLevel, _schedule, _transferInputs, _transferOutputs, addInitializable, defaultDependency, delayDependency, finish, fireAt, fireAt, fireAtCurrentTime, fireContainerAt, fireContainerAt, getCausalityInterface, getCurrentTime, getDeadline, getEnvironmentTime, getErrorTolerance, getExecutionAspect, getGlobalTime, getModelStartTime, getModelStopTime, getModelTime, getNextIterationTime, getStartTime, getStopTime, getTimeResolution, implementsStrictActorSemantics, initialize, invalidateResolvedTypes, isEmbedded, isFireFunctional, isStopRequested, isStrict, iterate, mutexLockObject, notifyTokenSentToCommunicationAspect, preinitialize, removeInitializable, requestInitialization, resume, scheduleContainedActors, setContainer, setCurrentTime, setEmbedded, setModelTime, setTimeResolution, stop, stopFire, suspend, terminate, transferOutputs, wrapup
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, 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, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isEmbedded
isFireFunctional, isStrict, iterate, stop, stopFire, terminate
addInitializable, removeInitializable, wrapup
description, getContainer, getDisplayName, getFullName, getName, getName, setName
protected StringParameter _library
public PthalesDirector(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.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class SDFDirector
attribute
- The changed parameter.IllegalActionException
- If the parameter set is not valid.SDFDirector.attributeChanged(ptolemy.kernel.util.Attribute)
public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class SDFDirector
workspace
- The workspace for the cloned object.java.lang.CloneNotSupportedException
- Not thrown in this base classNamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class SDFDirector
IllegalActionException
- If any actor executed by this
actor return false in prefire.InvalidStateException
- If this director does not have a
container.public java.lang.String getLibName() throws IllegalActionException
IllegalActionException
public Receiver newReceiver()
newReceiver
in class SDFDirector
public boolean prefire() throws IllegalActionException
prefire
in interface Executable
prefire
in class SDFDirector
IllegalActionException
- If the port methods throw it.public void preinitialize() throws IllegalActionException
preinitialize
in interface Initializable
preinitialize
in class SDFDirector
IllegalActionException
- If the preinitialize() method of
one of the associated actors throws it.public boolean transferInputs(IOPort port) throws IllegalActionException
transferInputs
in class SDFDirector
port
- The port to transfer tokens from.IllegalActionException
- If the port is not an opaque
input port, or if there are not enough input tokens available.public boolean transferOutputs(IOPort port) throws IllegalActionException
transferOutputs
in class SDFDirector
port
- The port to transfer tokens from.IllegalActionException
- If the port is not an opaque
output port.