Class CoroutineDirector

    • Method Detail

      • fire

        public void fire()
                  throws IllegalActionException
        Description copied from class: Director
        Iterate all the deeply contained actors of the container of this director exactly once. This method is not functional, since an iteration of the deeply contained actors may change state in their postfire() method. The actors are iterated in the order that they appear on the list returned by deepEntityList(), which is normally the order in which they were created.

        This method is not synchronized on the workspace, so the caller should be.

        In this base class, an attempt is made to fire each actor exactly once, in the order they were created. Prefire is called once, and if prefire returns true, then fire is called once, followed by postfire. The return value from postfire is ignored. If the container is not an instance of CompositeActor, however, then this method does nothing.

        Specified by:
        fire in interface Executable
        Overrides:
        fire in class Director
        Throws:
        IllegalActionException - If any called method of one of the associated actors throws it.
      • initialize

        public void initialize()
                        throws IllegalActionException
        Description copied from class: Director
        Initialize the model controlled by this director. Set the current time to the start time or the current time of the executive director, and then invoke the initialize() method of this director on each actor that is controlled by this director. If the container is not an instance of CompositeActor, do nothing. This method should typically be invoked once per execution, after the preinitialization phase, but before any iteration. It may be invoked in the middle of an execution, if reinitialization is desired. Since type resolution has been completed and the current time is set, the initialize() method of a contained actor may produce output or schedule events. If stop() is called during this methods execution, then stop initializing actors immediately. This method is not synchronized on the workspace, so the caller should be.
        Specified by:
        initialize in interface Initializable
        Overrides:
        initialize in class Director
        Throws:
        IllegalActionException - If the initialize() method of one of the associated actors throws it.
      • buildMapFromConnections

        public void buildMapFromConnections()
      • debugShowMap

        public void debugShowMap()
      • _extractMapSpec

        public java.lang.String[] _extractMapSpec​(Token t,
                                                  int n)
      • _getContinuation

        public Continuation _getContinuation​(java.lang.String name)
      • postfire

        public boolean postfire()
                         throws IllegalActionException
        Description copied from class: Director
        Return true if the director wishes to be scheduled for another iteration. This method is called by the container of this director to see whether the director wishes to execute anymore. It should not, in general, call postfire() on the contained actors.

        In this base class, return the false if stop() has been called since preinitialize(), and true otherwise. Derived classes that override this method need to respect this semantics. The protected variable _stopRequested indicates whether stop() has been called.

        Specified by:
        postfire in interface Executable
        Overrides:
        postfire in class Director
        Returns:
        True to continue execution, and false otherwise.
        Throws:
        IllegalActionException - Not thrown in this base class.
      • preinitialize

        public void preinitialize()
                           throws IllegalActionException
        Description copied from class: Director
        Validate the attributes and then invoke the preinitialize() methods of all its deeply contained actors. This method is invoked once per execution, before any iteration, and before the initialize() method. Time is not set during this stage. So preinitialize() method of actors should not make use of time. They should wait until the initialize phase of the execution.

        This method also resets the protected variable _stopRequested to false, so if a derived class overrides this method, then it should also do that.

        This method is not synchronized on the workspace, so the caller should be.

        Specified by:
        preinitialize in interface Initializable
        Overrides:
        preinitialize in class Director
        Throws:
        IllegalActionException - If the preinitialize() method of one of the associated actors throws it.
      • transferInputs

        public boolean transferInputs​(IOPort port)
                               throws IllegalActionException
        Description copied from class: Director
        Transfer data from an input port of the container to the ports it is connected to on the inside. The implementation in this base class transfers at most one token. Derived classes may override this method to transfer a domain-specific number of tokens.
        Overrides:
        transferInputs in class Director
        Parameters:
        port - The port to transfer tokens from.
        Returns:
        True if at least one data token is transferred.
        Throws:
        IllegalActionException - If the port is not an opaque input port.
      • transferOutputs

        public boolean transferOutputs​(IOPort port)
                                throws IllegalActionException
        Description copied from class: Director
        Transfer data from an output port of the container to the ports it is connected to on the outside. The implementation in this base class transfers at most one token, but derived classes may transfer more than one token.
        Overrides:
        transferOutputs in class Director
        Parameters:
        port - The port to transfer tokens from.
        Returns:
        True if at least one data token is transferred.
        Throws:
        IllegalActionException - If the port is not an opaque output port.
      • newReceiver

        public Receiver newReceiver()
        Description copied from class: Director
        Return a new receiver of a type compatible with this director. In this base class, this returns an instance of Mailbox.
        Overrides:
        newReceiver in class Director
        Returns:
        A new Mailbox.
      • _resetAllReceivers

        protected void _resetAllReceivers()
        Reset all receivers to unknown status and clear out variables used to track which actors fired in the last iteration.