Class TimedSource

    • Field Detail

      • stopTime

        public Parameter stopTime
        The time at which postfire() should return false. This is a double that defaults to Infinity, which means that postfire() never returns false (or at least, doesn't do so due to stopTime having been exceeded).
      • stopTimeIsLocal

        public Parameter stopTimeIsLocal
        If true, use the local time to compare against the stopTime parameter, rather than the global time. Local time may differ from global time inside modal models and certain domains that manipulate time. This is a boolean that defaults to false.
    • Method Detail

      • attributeChanged

        public void attributeChanged​(Attribute attribute)
                              throws IllegalActionException
        If the stopTime parameter is changed and the model is executing, then if the new value is greater than zero and greater than the current time, then ask the director to fire this actor at that time. If the new value is less than the current time, then request refiring at the current time.
        Overrides:
        attributeChanged in class NamedObj
        Parameters:
        attribute - The attribute that changed.
        Throws:
        IllegalActionException - If the superclass throws it.
      • getStopTime

        @Deprecated
        public double getStopTime()
        Deprecated.
        As of Ptolemy II 4.1, replaced by getModelStopTime()
        Get the stop time.
        Returns:
        The stop time.
      • getModelStopTime

        public Time getModelStopTime()
        Get the stop time.
        Returns:
        The stop time.
      • postfire

        public boolean postfire()
                         throws IllegalActionException
        Return false if the current time is greater than or equal to the stopTime parameter value. Otherwise, return true. Derived classes should call this at the end of their postfire() method and return its returned value.
        Specified by:
        postfire in interface Executable
        Overrides:
        postfire in class AtomicActor<TypedIOPort>
        Returns:
        True if execution can continue into the next iteration.
        Throws:
        IllegalActionException - Not thrown in this base class.
      • prefire

        public boolean prefire()
                        throws IllegalActionException
        Return false if the current time is greater than or equal to the stopTime parameter value. Otherwise, return what the superclass returns.
        Specified by:
        prefire in interface Executable
        Overrides:
        prefire in class Source
        Returns:
        True, unless the trigger input is connected and has no input.
        Throws:
        IllegalActionException - Not thrown in this base class.