Class PteraController

    • Field Detail

      • LIFO

        public Parameter LIFO
        A Boolean parameter that decides whether simultaneous events should be placed in the event queue in the last-in-first-out (LIFO) fashion or not.
      • director

        public PteraDirector director
        The Ptera director contained by this controller.
    • Method Detail

      • clone

        public java.lang.Object clone​(Workspace workspace)
                               throws java.lang.CloneNotSupportedException
        Clone the controller into the specified workspace. This calls the base class and then sets the attribute public members to refer to the attributes of the new actor.
        Overrides:
        clone in class FSMActor
        Parameters:
        workspace - The workspace for the new controller.
        Returns:
        A new PteraController.
        Throws:
        java.lang.CloneNotSupportedException - If a derived class contains an attribute that cannot be cloned.
        See Also:
        NamedObj.exportMoML(Writer, int, String), NamedObj.setDeferringChangeRequests(boolean)
      • getCausalityInterface

        public CausalityInterface getCausalityInterface()
        Return a causality interface for this actor. This method returns the causality interface where no output port depends on the input ports. It is an instance of BreakCausalityInterface. FIXME: A causality interface special for Ptera should be returned instead.
        Specified by:
        getCausalityInterface in interface Actor
        Overrides:
        getCausalityInterface in class FSMActor
        Returns:
        A representation of the dependencies between input ports and output ports.
      • getDirector

        public Director getDirector()
        Return the director responsible for the execution of this actor.
        Specified by:
        getDirector in interface Actor
        Overrides:
        getDirector in class FSMActor
        Returns:
        The director responsible for the execution of this actor.
      • getExecutiveDirector

        public Director getExecutiveDirector()
        Return the executive director. If the current controller is the top-level controller of an Ptera modal model, then the executive director is its director (returned by getDirector()). Otherwise, the executive director is the director of the Ptera controller at a higher level in the refinement hierarchy.
        Specified by:
        getExecutiveDirector in interface Actor
        Overrides:
        getExecutiveDirector in class FSMActor
        Returns:
        The executive director.
      • getInitialState

        public State getInitialState()
        Return null as the initial state. In Ptera there are multiple initial events. This method is overridden to return null. To get the list of initial events, check the isInitialState parameter of the events contained in this controller.
        Overrides:
        getInitialState in class FSMActor
        Returns:
        null
      • isFireFunctional

        public boolean isFireFunctional()
        Return the result of isFireFunctional() from the director.
        Specified by:
        isFireFunctional in interface Executable
        Overrides:
        isFireFunctional in class FSMActor
        Returns:
        The result of isFireFunctional() from the director.
      • iterate

        public int iterate​(int count)
                    throws IllegalActionException
        Invoke a specified number of iterations of the actor by calling iterate() of the director. An iteration is equivalent to invoking prefire(), fire(), and postfire(), in that order. In an iteration, if prefire() returns true, then fire() will be called once, followed by postfire(). Otherwise, if prefire() returns false, fire() and postfire() are not invoked, and this method returns NOT_READY. If postfire() returns false, then no more iterations are invoked, and this method returns STOP_ITERATING. Otherwise, it returns COMPLETED. If stop() is called while this is executing, then cease executing and return STOP_ITERATING.
        Specified by:
        iterate in interface Executable
        Overrides:
        iterate in class FSMActor
        Parameters:
        count - The number of iterations to perform.
        Returns:
        NOT_READY, STOP_ITERATING, or COMPLETED.
        Throws:
        IllegalActionException - If iterating is not permitted, or if prefire(), fire(), or postfire() throw it.
      • readInputs

        public void readInputs()
                        throws IllegalActionException
        Set the value of the shadow variables for input ports of this actor. This method skips over ports that connected to outputs of a refinement.
        Overrides:
        readInputs in class FSMActor
        Throws:
        IllegalActionException - If a shadow variable cannot take the token read from its corresponding channel (should not occur).
      • stop

        public void stop()
        Stop execution by invoking stop() of the director.
        Specified by:
        stop in interface Executable
        Overrides:
        stop in class FSMActor
      • stopFire

        public void stopFire()
        Request that execution of the current iteration stop as soon as possible by invoking stopFire() of the director.
        Specified by:
        stopFire in interface Executable
        Overrides:
        stopFire in class FSMActor
      • synchronizeToRealtime

        public boolean synchronizeToRealtime()
        Return whether the synchronizeToRealtime attribute of this controller is set or not.
        Returns:
        True if synchronizedToRealtime is set; false otherwise.
      • typeConstraints

        public java.util.Set<Inequality> typeConstraints()
        Return the type constraints of this actor. The constraints have the form of a set of inequalities. This method first creates constraints such that the type of any input port that does not have its type declared must be less than or equal to the type of any output port that does not have its type declared. Type constraints from the contained Typeables (ports, variables, and parameters) are collected. In addition, type constraints from all the transitions are added. These constraints are determined by the guard and trigger expressions of transitions, and actions contained by the transitions. This method is read-synchronized on the workspace.
        Specified by:
        typeConstraints in interface TypedActor
        Overrides:
        typeConstraints in class FSMActor
        Returns:
        A list of inequalities.
        See Also:
        Inequality
      • _getRefinementClasses

        protected java.util.TreeMap<java.lang.Class<? extends Entity>,​java.lang.String> _getRefinementClasses()
        Return a map from the classes of the entities to be dropped into a state and the class names of the refinements that can be used to contain those entities.
        Overrides:
        _getRefinementClasses in class ModalController
        Returns:
        The map.
      • _setCurrentEvent

        protected void _setCurrentEvent​(Event event)
        Set the event currently being executed.
        Parameters:
        event - The current event.