Class CaseDirector

    • Constructor Detail

      • CaseDirector

        public CaseDirector​(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.
        Parameters:
        container - Container of this director.
        name - Name of this director.
        Throws:
        IllegalActionException - If the name has a period in it, or the director is not compatible with the specified container.
        NameDuplicationException - If the container not a CompositeActor and the name collides with an entity in the container.
    • Method Detail

      • fireAt

        public Time fireAt​(Actor actor,
                           Time time,
                           int microstep)
                    throws IllegalActionException
        Schedule a firing of the given actor at the given time. If there is an executive director, this method delegates to it. Otherwise, it sets its own notion of current time to that specified in the argument. The reason for this is to enable Case to be a top-level actor and to support the design pattern where a director requests a refiring at the next time it wishes to be awakened, just prior to returning from fire(). DEDirector, for example, does that, as does the SDFDirector if the period parameter is set.
        Overrides:
        fireAt in class Director
        Parameters:
        actor - The actor scheduled to be fired.
        time - The scheduled time.
        microstep - The microstep.
        Returns:
        The time returned by the executive director, or or the specified time if there isn't one.
        Throws:
        IllegalActionException - If by the executive director.
        See Also:
        Director.fireAtCurrentTime(Actor), Director.fireContainerAt(Time)
      • newReceiver

        public Receiver newReceiver()
        Return a receiver that is a one-place buffer. A token put into the receiver will overwrite any token already in the receiver.
        Overrides:
        newReceiver in class Director
        Returns:
        A receiver that is a one-place buffer.
      • prefire

        public boolean prefire()
                        throws IllegalActionException
        Read the control token input, transfer input tokens, and invoke prefire() of the selected refinement.
        Specified by:
        prefire in interface Executable
        Overrides:
        prefire in class Director
        Returns:
        True.
        Throws:
        IllegalActionException - If there is no director, or if the director's prefire() method throws it, or if this actor is not opaque.
      • postfire

        public boolean postfire()
                         throws IllegalActionException
        Invoke the postfire() method of the current local director.
        Specified by:
        postfire in interface Executable
        Overrides:
        postfire in class Director
        Returns:
        True if the execution can continue into the next iteration.
        Throws:
        IllegalActionException - If there is no director, or if the director's postfire() method throws it, or if this actor is not opaque.