Class ConstantRateSegment

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected double crLL
      the lower limit of the interval on cumulative rate scale
      protected double crUL
      the upper limit of the interval on the cumulative rate scale
      protected double crWidth
      the width of the interval on the cumulative rate scale (crWidth = crUL - crLL)
      protected double rate
      the rate for the interval
      protected double tLL
      the lower limit of the interval on the time scale
      protected double tUL
      the upper limit of the interval on the time scale
      protected double tWidth
      the width of the interval on the time scale (tWidth = tUL - tLL)
    • Constructor Summary

      Constructors 
      Constructor Description
      ConstantRateSegment​(double crLower, double tLower, double duration, double rate)  
    • Field Detail

      • rate

        protected double rate
        the rate for the interval
      • crWidth

        protected double crWidth
        the width of the interval on the cumulative rate scale (crWidth = crUL - crLL)
      • crLL

        protected double crLL
        the lower limit of the interval on cumulative rate scale
      • crUL

        protected double crUL
        the upper limit of the interval on the cumulative rate scale
      • tWidth

        protected double tWidth
        the width of the interval on the time scale (tWidth = tUL - tLL)
      • tLL

        protected double tLL
        the lower limit of the interval on the time scale
      • tUL

        protected double tUL
        the upper limit of the interval on the time scale
    • Constructor Detail

      • ConstantRateSegment

        public ConstantRateSegment​(double crLower,
                                   double tLower,
                                   double duration,
                                   double rate)
        Parameters:
        crLower - represents the cumulative rate at the beginning of the segment, must be >=0
        tLower - represents the time at the beginning of the segment, must be >=0
        duration - represents the time duration of the segment, must be >=0
        rate - represents the rate for the time segment, must be 0 < rate <= infinity
    • Method Detail

      • contains

        public boolean contains​(double time)
        Description copied from interface: RateSegmentIfc
        Returns true if the supplied time is within this rate segments time interval
        Specified by:
        contains in interface RateSegmentIfc
        Parameters:
        time - the time to be evaluated
        Returns:
        true if in the segment
      • setInterval

        public final void setInterval​(double tLower,
                                      double duration)
        Parameters:
        tLower - the lower time limit of the interval, must be > = 0
        duration - the duration of the interval, must be > 0
      • setRate

        public final void setRate​(double crLower,
                                  double rate)
        Parameters:
        crLower - represents the cumulative rate at the beginning of the segment, must be >=0
        rate - represents the rate for the time segment, must be 0 < rate < = infinity
      • getRate

        public double getRate()
        Returns the rate for the interval
        Returns:
        the rate
      • getRate

        public double getRate​(double time)
        Gets the rate for the time within the interval
        Specified by:
        getRate in interface RateSegmentIfc
        Parameters:
        time - the time to evaluate
        Returns:
        the rate at the time
      • getRateAtLowerTimeLimit

        public double getRateAtLowerTimeLimit()
        Description copied from interface: RateSegmentIfc
        The rate at the time that the time interval begins
        Specified by:
        getRateAtLowerTimeLimit in interface RateSegmentIfc
        Returns:
        The rate at the time that the time interval begins
      • getRateAtUpperTimeLimit

        public double getRateAtUpperTimeLimit()
        The rate at the upper time limit is undefined Double.NaN. The rate for the segment is constant throughout the interval but undefined at the end of the interval
        Specified by:
        getRateAtUpperTimeLimit in interface RateSegmentIfc
        Returns:
        The rate at the time that the time interval ends
      • getLowerTimeLimit

        public double getLowerTimeLimit()
        The lower time limit
        Specified by:
        getLowerTimeLimit in interface RateSegmentIfc
        Returns:
        The lower time limit
      • getUpperTimeLimit

        public double getUpperTimeLimit()
        The upper time limit
        Specified by:
        getUpperTimeLimit in interface RateSegmentIfc
        Returns:
        The upper time limit
      • getTimeWidth

        public double getTimeWidth()
        The width of the interval
        Specified by:
        getTimeWidth in interface RateSegmentIfc
        Returns:
        The width of the interval
      • getCumulativeRateLowerLimit

        public double getCumulativeRateLowerLimit()
        The lower limit on the cumulative rate axis
        Specified by:
        getCumulativeRateLowerLimit in interface RateSegmentIfc
        Returns:
        The lower limit on the cumulative rate axis
      • getCumulativeRateUpperLimit

        public double getCumulativeRateUpperLimit()
        The upper limit on the cumulative rate axis
        Specified by:
        getCumulativeRateUpperLimit in interface RateSegmentIfc
        Returns:
        The upper limit on the cumulative rate axis
      • getCumulativeRateIntervalWidth

        public double getCumulativeRateIntervalWidth()
        The cumulative rate interval width
        Specified by:
        getCumulativeRateIntervalWidth in interface RateSegmentIfc
        Returns:
        The cumulative rate interval width
      • getCumulativeRate

        public double getCumulativeRate​(double time)
        Returns the value of the cumulative rate function for the interval given a value of time within that interval
        Specified by:
        getCumulativeRate in interface RateSegmentIfc
        Parameters:
        time - the time to be evaluated
        Returns:
        cumulative rate at time t
      • getInverseCumulativeRate

        public double getInverseCumulativeRate​(double cumRate)
        Returns the inverse of the cumulative rate function given the interval and a cumulative rate value within that interval. Returns a time
        Specified by:
        getInverseCumulativeRate in interface RateSegmentIfc
        Parameters:
        cumRate - the rate to be evaluated
        Returns:
        the inverse at the rate
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object