Class HybridModalDirector

    • Constructor Detail

      • HybridModalDirector

        public HybridModalDirector​(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 is not a CompositeActor and the name collides with an entity in the container.
    • Method Detail

      • clone

        public java.lang.Object clone​(Workspace workspace)
                               throws java.lang.CloneNotSupportedException
        Clone the actor 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 FSMDirector
        Parameters:
        workspace - The workspace for the new actor.
        Returns:
        A new FSMActor.
        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)
      • fire

        public void fire()
                  throws IllegalActionException
        Fire the model model for one iteration. Override the base class to avoid firing the controller during intermediate stages of a multi-step solver.
        Specified by:
        fire in interface Executable
        Overrides:
        fire in class FSMDirector
        Throws:
        IllegalActionException - If there is more than one transition enabled and nondeterminism is not permitted, or there is no controller, or it is thrown by any choice action.
      • getErrorTolerance

        public final double getErrorTolerance()
        Return error tolerance used for detecting enabled transitions. If there is an enclosing continuous director, then get the error tolerance from that director. Otherwise, return 1e-4.
        Returns:
        The error tolerance used for detecting enabled transitions.
      • isStepSizeAccurate

        public boolean isStepSizeAccurate()
        Return true if all actors that were fired in the current iteration report that the step size is accurate and if no transition is enabled.
        Specified by:
        isStepSizeAccurate in interface ContinuousStepSizeController
        Returns:
        True if the current step is accurate.
      • postfire

        public boolean postfire()
                         throws IllegalActionException
        Override the base class so that if there is no enabled transition then we record for each comparison operation in each guard expression the distance between the current value of the variable being compared and the threshold.
        Specified by:
        postfire in interface Executable
        Overrides:
        postfire in class FSMDirector
        Returns:
        True if the mode controller wishes to be scheduled for another iteration.
        Throws:
        IllegalActionException - If thrown by any commit action or there is no controller.
      • prefire

        public boolean prefire()
                        throws IllegalActionException
        Override the base class to set current time to match that of the enclosing executive director, if there is one, regardless of whether that time is in the future or past. The superclass sets current time only if the local time is less than the environment time. Initialize the firing of the director by resetting all receivers to unknown.
        Specified by:
        prefire in interface Executable
        Overrides:
        prefire in class FSMDirector
        Returns:
        Whatever the superclass returns.
        Throws:
        IllegalActionException - If thrown by the superclass.
      • _enclosingContinuousDirector

        protected ContinuousDirector _enclosingContinuousDirector()
        Return the enclosing continuous director, or null if there is none. The enclosing continuous director is a director above this in the hierarchy, possibly separated by composite actors with other foreign directors.
        Returns:
        The enclosing ContinuousDirector, or null if there is none.