Class ComponentActor

    • Field Detail

      • input

        public ptolemy.component.ComponentActor.IOMethodPort input
      • output

        public ptolemy.component.ComponentActor.IOMethodPort output
    • Constructor Detail

      • ComponentActor

        public ComponentActor​(CompositeEntity container,
                              java.lang.String name)
                       throws IllegalActionException,
                              NameDuplicationException
        Construct an entity with the given name contained by the specified entity. The container argument must not be null, or a NullPointerException will be thrown. This entity 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. This constructor write-synchronizes on the workspace.
        Parameters:
        container - The container entity.
        name - The name of the entity.
        Throws:
        IllegalActionException - If the entity cannot be contained by the proposed container.
        NameDuplicationException - If the name coincides with an entity already in the container.
    • Method Detail

      • clone

        public java.lang.Object clone​(Workspace workspace)
                               throws java.lang.CloneNotSupportedException
        Clone the actor into the specified workspace. The new object is not added to the directory of that workspace (you must do this yourself if you want it there). The result is a composite actor with clones of the ports of the original actor, the contained actors, and the contained relations. The ports of the returned actor are not connected to anything. The connections of the relations are duplicated in the new composite, unless they cross levels, in which case an exception is thrown. The local director is cloned, if there is one. The executive director is not cloned. NOTE: This will not work if there are level-crossing transitions.
        Overrides:
        clone in class CompositeActor
        Parameters:
        workspace - The workspace for the cloned object.
        Returns:
        A new CompositeActor.
        Throws:
        java.lang.CloneNotSupportedException - If the actor contains level crossing transitions so that its connections cannot be cloned, or if one of the attributes cannot be cloned.
        See Also:
        NamedObj.exportMoML(Writer, int, String), NamedObj.setDeferringChangeRequests(boolean)
      • connectionsChanged

        public void connectionsChanged​(Port port)
        Invalidate the schedule and type resolution and create new receivers if the specified port is an opaque output port. Also, notify the containers of any ports deeply connected on the inside by calling their connectionsChanged() methods, since their width may have changed.
        Overrides:
        connectionsChanged in class CompositeActor
        Parameters:
        port - The port that has connection changes.
      • fire

        public void fire()
                  throws IllegalActionException
        If this actor is opaque, transfer any data from the input ports of this composite to the ports connected on the inside, and then invoke the fire() method of its local director. The transfer is accomplished by calling the transferInputs() method of the local director (the exact behavior of which depends on the domain). If the actor is not opaque, throw an exception. This method is read-synchronized on the workspace, so the fire() method of the director need not be (assuming it is only called from here). After the fire() method of the director returns, send any output data created by calling the local director's transferOutputs method.
        Specified by:
        fire in interface Executable
        Overrides:
        fire in class CompositeActor
        Throws:
        IllegalActionException - If there is no director, or if the director's fire() method throws it, or if the actor is not opaque.
      • run

        public void run()
                 throws IllegalActionException
        Execute the component, which in this base class means doing nothing and returning immediately. This is invoked after preinitialize() and initialize(), and may be invoked repeatedly.
        Specified by:
        run in interface Component
        Throws:
        IllegalActionException - If the run cannot be completed (not thrown in this base class).
      • initialize

        public void initialize()
                        throws IllegalActionException
        Description copied from class: CompositeActor
        Initialize this actor. If this actor is opaque, invoke the initialize() method of its local director. Otherwise, throw an exception. This method is read-synchronized on the workspace, so the initialize() method of the director need not be (assuming it is only called from here).
        Specified by:
        initialize in interface Component
        Specified by:
        initialize in interface Initializable
        Overrides:
        initialize in class CompositeActor
        Throws:
        IllegalActionException - If there is no director, or if the director's initialize() method throws it, or if the actor is not opaque.
      • _executeInside

        protected TupleToken _executeInside()
        Invoke one iteration and transfer the token to a method call.
      • _addRelation

        protected void _addRelation​(ComponentRelation relation)
                             throws IllegalActionException,
                                    NameDuplicationException
        Description copied from class: TypedCompositeActor
        Add a relation to this container. This overrides the base class to throw an exception if the proposed relation is not an instance of TypedIORelation. This method should not be used directly. Call the setContainer() method of the relation instead. This method does not set the container of the relation to refer to this container. This method is not synchronized on the workspace, so the caller should be.
        Overrides:
        _addRelation in class TypedCompositeActor
        Parameters:
        relation - The TypedIORelation to contain.
        Throws:
        IllegalActionException - If the relation has no name, or is not an instance of TypedIORelation.
        NameDuplicationException - If the name collides with a name already on the contained relations list.