Class Task

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class Task
    extends TypedCompositeActor
    A task in the taskpt domain. It consumes all input tokens at the beginning and produces all output tokens at the end.

    Input and output tokens are not passed directly, but via pointers that point to an address (range) in a shared memory that is controlled by the director of the container of a task. That's why a task has input/output ports for specifying the outputs. The token on the outside of this port specifies the address, where the tokens have to be stored in the shared memory. The inside of this port receives the tokens to be stored. A task works on copies of the data read from memory. A TaskDirector takes care of transferring the outputs and inputs. The TaskDirector also provides a shared memory that is exclusive to all actors within this task. This ensures that a task is free of side effects.

    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Bastian Ristau
    Pt.AcceptedRating:
    red (ristau)
    Pt.ProposedRating:
    red (ristau)
    • Constructor Detail

      • Task

        public Task​(CompositeEntity container,
                    java.lang.String name)
             throws IllegalActionException,
                    NameDuplicationException
        Construct a Task with a name and a container. The container argument must not be null, or a NullPointerException will be thrown. This actor will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. Increment the version of the workspace. The director of the Task is set to be a TaskDirector.
        Parameters:
        container - The container.
        name - The name of this actor.
        Throws:
        IllegalActionException - Thrown if the container is incompatible with this actor.
        NameDuplicationException - Thrown if the name coincides with an actor already in the container.