Package ptolemy.domains.taskpt.kernel
Class TaskDirector
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Cloneable
,Executable
,Initializable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class TaskDirector extends TaskPtDirector
A director for controlling a task in the taskpt domain. This director only accepts tokens of type PtrToken on its ports connected to upstream actors in the higher level composite. Pure output ports are ignored by this director.When transferring data from higher level composites, the director does not pass the incoming tokens directly. If the port is a pure input port, tokens are read from the address specified in the PtrToken from the shared memory controlled by the higher level director and are passed to the downstream actors inside. If the port is an input/output port, the data send from the actors inside are stored in the shared memory of the higher level director after all the actors controlled by this director have finished execution.
- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Bastian Ristau
- See Also:
Task
- Pt.AcceptedRating:
- red (ristau)
- Pt.ProposedRating:
- red (ristau)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.domains.sequence.gui.VisualSequenceDirector
VisualSequenceDirector.SequenceConfigureFactory
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
-
Fields inherited from class ptolemy.domains.sequence.gui.VisualSequenceDirector
icon, scheduleText
-
Fields inherited from class ptolemy.domains.sequence.kernel.SequencedModelDirector
_iterationCount, _postfireReturns, _scheduler, _sequencedList, defaultOutputInitialValue, fireUnexecutedActors, iterations, userDefinedDefaultOutputInitialValue, userDefinedOutputInitialValue
-
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 TaskDirector(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 protected boolean
_transferInputs(IOPort port)
Read data from the shared memory from the location specified by the incoming token and broadcast the data to the actors inside.protected boolean
_transferOutputs(IOPort port)
Write the outputs from the inside to the address specified by the PtrToken present outside.-
Methods inherited from class ptolemy.domains.taskpt.kernel.TaskPtDirector
_init, _setInitialValues, getMemory, initialize, newReceiver, postfire
-
Methods inherited from class ptolemy.domains.sequence.kernel.SequenceDirector
fire, preinitialize
-
Methods inherited from class ptolemy.domains.sequence.kernel.SequencedModelDirector
_getInitialValueParameterName, _setScheduler, checkAttributeType, clone, fireSchedule, getContainedEntities, getScheduler, invalidateSchedule, isScheduleValid, setOutputInitialValues, setScheduler, suggestedModalModelDirectors, supportMultirateFiring
-
Methods inherited from class ptolemy.actor.Director
_actorFinished, _consultTimeRegulators, _description, _isEmbedded, _isTopLevel, _schedule, addInitializable, attributeChanged, createSchedule, defaultDependency, delayDependency, elapsedTimeSinceStart, finish, fireAt, fireAt, fireAt, fireAtCurrentTime, fireContainerAt, fireContainerAt, getCausalityInterface, getCurrentTime, getDeadline, getEnvironmentTime, getExecutionAspect, getGlobalTime, getModelNextIterationTime, getModelStartTime, getModelStopTime, getModelTime, getNextIterationTime, getStartTime, getStopTime, getTimeResolution, implementsStrictActorSemantics, initialize, invalidateResolvedTypes, isEmbedded, isFireFunctional, isStopRequested, isStrict, iterate, mutexLockObject, notifyTokenSentToCommunicationAspect, prefire, preinitialize, removeInitializable, requestInitialization, resume, resumeActor, scheduleContainedActors, setContainer, setCurrentTime, setEmbedded, setModelTime, setTimeResolution, stop, stopFire, suspend, terminate, transferInputs, transferOutputs, 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, handleModelError, 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
-
-
-
-
Constructor Detail
-
TaskDirector
public TaskDirector(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 director will have a default scheduler of type SequenceScheduler. In addition to invoking the base class constructor the memory is initialized.- Parameters:
container
- Container of the director.name
- Name of this director.- Throws:
IllegalActionException
- Thrown if the director is not compatible with the specified container. May be thrown in a derived class.NameDuplicationException
- Thrown if the container is not a CompositeActor and the name collides with an entity in the container.
-
-
Method Detail
-
_transferInputs
protected boolean _transferInputs(IOPort port) throws IllegalActionException
Read data from the shared memory from the location specified by the incoming token and broadcast the data to the actors inside.- Overrides:
_transferInputs
in classTaskPtDirector
- Parameters:
port
- The port to be inspected.- Returns:
- True, if input is transferred or it is also an output port that specifies the address, where the output of the actors inside has to be written.
- Throws:
IllegalActionException
- Thrown if the width of the port is not exactly one, the input is not of type PtrToken, no memory is found where to write the data, it is not an output port or the port is not opaque.- See Also:
IOPort.transferInputs()
-
_transferOutputs
protected boolean _transferOutputs(IOPort port) throws IllegalActionException
Write the outputs from the inside to the address specified by the PtrToken present outside.- Overrides:
_transferOutputs
in classTaskPtDirector
- Parameters:
port
- The port to be inspected.- Returns:
- True, if an output is transferred.
- Throws:
IllegalActionException
- Thrown if the port is not an input/output port, there is no PtrToken present specifying the address where to write data, no memory is found where to write the data, it is not an output port or the port is not opaque.
-
-