Class TaskDirector

  • 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)
    • 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 class TaskPtDirector
        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 class TaskPtDirector
        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.