Class NondeterministicMerge

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

    public class NondeterministicMerge
    extends TypedCompositeActor
    This actor takes any number of input streams and merges them nondeterministically. This actor is intended for use in the PN domain. It is a composite actor that creates its own contents. It contains an instance of PNDirector and one actor for each input channel (it creates these actors automatically when a connection is created to the input multiport). The contained actors are special actors (implemented as an instance of an inner class) that read from the port of this actor and write to the port of this actor. They have no ports of their own. The lifecycle of the contained actors (when they are started or stopped) is handled by the PNDirector in the usual way.
    Since:
    Ptolemy II 4.1
    Version:
    $Id$
    Author:
    Edward A. Lee, Haibo Zeng
    Pt.AcceptedRating:
    Red (eal)
    Pt.ProposedRating:
    Yellow (eal)
    • Field Detail

      • input

        public TypedIOPort input
        The input port. This base class imposes no type constraints except that the type of the input cannot be greater than the type of the output.
      • output

        public TypedIOPort output
        The output port. By default, the type of this output is constrained to be at least that of the input.
      • channel

        public TypedIOPort channel
        Output port used to indicate which input channel the current output came from. This has type int.
    • Constructor Detail

      • NondeterministicMerge

        public NondeterministicMerge​(Workspace workspace)
                              throws NameDuplicationException,
                                     IllegalActionException
        Construct a TypedCompositeActor in the specified workspace with no container and an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace. You should set the local director or executive director before attempting to send data to the actor or to execute it. Add the actor to the workspace directory. Increment the version number of the workspace.
        Parameters:
        workspace - The workspace that will list the actor.
        Throws:
        NameDuplicationException - If an actor with an identical name already exists in the container.
        IllegalActionException - If the actor cannot be contained by the proposed container.
    • Method Detail

      • connectionsChanged

        public void connectionsChanged​(Port port)
        Override the base class to adjust the number of contained actors, if the number is no longer correct.
        Overrides:
        connectionsChanged in class CompositeActor
        Parameters:
        port - The port that has connection changes.
      • clone

        public java.lang.Object clone​(Workspace workspace)
                               throws java.lang.CloneNotSupportedException
        Clone the object into the specified workspace. This overrides the base class to set instantiate a new MergeDirector,
        Overrides:
        clone in class CompositeActor
        Parameters:
        workspace - The workspace for the new object.
        Returns:
        A new NamedObj.
        Throws:
        java.lang.CloneNotSupportedException - If any of the attributes cannot be cloned.
        See Also:
        CompositeEntity.exportMoML(Writer, int, String)