Class LinearRateSegment
- java.lang.Object
-
- jsl.modeling.elements.variable.nhpp.LinearRateSegment
-
- All Implemented Interfaces:
RateSegmentIfc
public class LinearRateSegment extends java.lang.Object implements RateSegmentIfc
-
-
Field Summary
Fields Modifier and Type Field Description protected doublecrLLthe lower limit of the interval on cumulative rate scaleprotected doublecrULthe upper limit of the interval on the cumulative rate scaleprotected doublecrWidththe width of the interval on the cumulative rate scale (crWidth = crUL - crLL)protected doublerLLthe rate at the lower limit of the intervalprotected doublerULthe rate at the upper limit of the intervalprotected doubleslopethe slope for the intervalprotected doubletLLthe lower limit of the interval on the time scaleprotected doubletULthe upper limit of the interval on the time scaleprotected doubletWidththe width of the interval on the time scale (tWidth = tUL - tLL)
-
Constructor Summary
Constructors Modifier Constructor Description protectedLinearRateSegment(double cumRateLL, double timeLL, double rateLL, double timeUL, double rateUL)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(double time)Returns true if the supplied time is within this rate segments time intervaldoublegetCumulativeRate(double time)Returns the value of the cumulative rate function for the interval given a value of time within that intervaldoublegetCumulativeRateIntervalWidth()The cumulative rate interval widthdoublegetCumulativeRateLowerLimit()The lower limit on the cumulative rate axisdoublegetCumulativeRateUpperLimit()The upper limit on the cumulative rate axisdoublegetInverseCumulativeRate(double cumRate)Returns the inverse of the cumulative rate function given the interval and a cumulative rate value within that interval.doublegetLowerTimeLimit()The lower time limitdoublegetRate(double time)Returns the rate for the intervaldoublegetRateAtLowerTimeLimit()The rate at the time that the time interval beginsdoublegetRateAtUpperTimeLimit()The rate at the time that the time interval endsdoublegetSlope()doublegetTimeWidth()The width of the intervaldoublegetUpperTimeLimit()The upper time limitLinearRateSegmentnewInstance()Returns a new instance of the rate segmentjava.lang.StringtoString()
-
-
-
Field Detail
-
slope
protected double slope
the slope for the interval
-
rLL
protected double rLL
the rate at the lower limit of the interval
-
rUL
protected double rUL
the rate at the upper limit of 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
-
-
Method Detail
-
newInstance
public LinearRateSegment newInstance()
Description copied from interface:RateSegmentIfcReturns a new instance of the rate segment- Specified by:
newInstancein interfaceRateSegmentIfc- Returns:
- a new instance of the rate segment
-
contains
public boolean contains(double time)
Description copied from interface:RateSegmentIfcReturns true if the supplied time is within this rate segments time interval- Specified by:
containsin interfaceRateSegmentIfc- Parameters:
time- the time to be evaluated- Returns:
- true if in the segment
-
getSlope
public double getSlope()
-
getRate
public double getRate(double time)
Description copied from interface:RateSegmentIfcReturns the rate for the interval- Specified by:
getRatein interfaceRateSegmentIfc- Parameters:
time- the time to evaluate- Returns:
- the rate at the time
-
getRateAtLowerTimeLimit
public double getRateAtLowerTimeLimit()
Description copied from interface:RateSegmentIfcThe rate at the time that the time interval begins- Specified by:
getRateAtLowerTimeLimitin interfaceRateSegmentIfc- Returns:
- The rate at the time that the time interval begins
-
getRateAtUpperTimeLimit
public double getRateAtUpperTimeLimit()
Description copied from interface:RateSegmentIfcThe rate at the time that the time interval ends- Specified by:
getRateAtUpperTimeLimitin interfaceRateSegmentIfc- Returns:
- The rate at the time that the time interval ends
-
getLowerTimeLimit
public double getLowerTimeLimit()
Description copied from interface:RateSegmentIfcThe lower time limit- Specified by:
getLowerTimeLimitin interfaceRateSegmentIfc- Returns:
- The lower time limit
-
getUpperTimeLimit
public double getUpperTimeLimit()
Description copied from interface:RateSegmentIfcThe upper time limit- Specified by:
getUpperTimeLimitin interfaceRateSegmentIfc- Returns:
- The upper time limit
-
getTimeWidth
public double getTimeWidth()
Description copied from interface:RateSegmentIfcThe width of the interval- Specified by:
getTimeWidthin interfaceRateSegmentIfc- Returns:
- The width of the interval
-
getCumulativeRateLowerLimit
public double getCumulativeRateLowerLimit()
Description copied from interface:RateSegmentIfcThe lower limit on the cumulative rate axis- Specified by:
getCumulativeRateLowerLimitin interfaceRateSegmentIfc- Returns:
- The lower limit on the cumulative rate axis
-
getCumulativeRateUpperLimit
public double getCumulativeRateUpperLimit()
Description copied from interface:RateSegmentIfcThe upper limit on the cumulative rate axis- Specified by:
getCumulativeRateUpperLimitin interfaceRateSegmentIfc- Returns:
- The upper limit on the cumulative rate axis
-
getCumulativeRateIntervalWidth
public double getCumulativeRateIntervalWidth()
Description copied from interface:RateSegmentIfcThe cumulative rate interval width- Specified by:
getCumulativeRateIntervalWidthin interfaceRateSegmentIfc- Returns:
- The cumulative rate interval width
-
getCumulativeRate
public double getCumulativeRate(double time)
Description copied from interface:RateSegmentIfcReturns the value of the cumulative rate function for the interval given a value of time within that interval- Specified by:
getCumulativeRatein interfaceRateSegmentIfc- Parameters:
time- the time to be evaluated- Returns:
- the cumulative rate at the given time
-
getInverseCumulativeRate
public double getInverseCumulativeRate(double cumRate)
Description copied from interface:RateSegmentIfcReturns the inverse of the cumulative rate function given the interval and a cumulative rate value within that interval. Returns a time- Specified by:
getInverseCumulativeRatein interfaceRateSegmentIfc- Parameters:
cumRate- the cumulative rate- Returns:
- the inverse of the cumulative rate function
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-