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 double
crLL
the lower limit of the interval on cumulative rate scaleprotected double
crUL
the upper limit of the interval on the cumulative rate scaleprotected double
crWidth
the width of the interval on the cumulative rate scale (crWidth = crUL - crLL)protected double
rLL
the rate at the lower limit of the intervalprotected double
rUL
the rate at the upper limit of the intervalprotected double
slope
the slope for the intervalprotected double
tLL
the lower limit of the interval on the time scaleprotected double
tUL
the upper limit of the interval on the time scaleprotected double
tWidth
the width of the interval on the time scale (tWidth = tUL - tLL)
-
Constructor Summary
Constructors Modifier Constructor Description protected
LinearRateSegment(double cumRateLL, double timeLL, double rateLL, double timeUL, double rateUL)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(double time)
Returns true if the supplied time is within this rate segments time intervaldouble
getCumulativeRate(double time)
Returns the value of the cumulative rate function for the interval given a value of time within that intervaldouble
getCumulativeRateIntervalWidth()
The cumulative rate interval widthdouble
getCumulativeRateLowerLimit()
The lower limit on the cumulative rate axisdouble
getCumulativeRateUpperLimit()
The upper limit on the cumulative rate axisdouble
getInverseCumulativeRate(double cumRate)
Returns the inverse of the cumulative rate function given the interval and a cumulative rate value within that interval.double
getLowerTimeLimit()
The lower time limitdouble
getRate(double time)
Returns the rate for the intervaldouble
getRateAtLowerTimeLimit()
The rate at the time that the time interval beginsdouble
getRateAtUpperTimeLimit()
The rate at the time that the time interval endsdouble
getSlope()
double
getTimeWidth()
The width of the intervaldouble
getUpperTimeLimit()
The upper time limitLinearRateSegment
newInstance()
Returns a new instance of the rate segmentjava.lang.String
toString()
-
-
-
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:RateSegmentIfc
Returns a new instance of the rate segment- Specified by:
newInstance
in interfaceRateSegmentIfc
- Returns:
- a new instance of the rate segment
-
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 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:RateSegmentIfc
Returns the rate for the interval- Specified by:
getRate
in interfaceRateSegmentIfc
- 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 interfaceRateSegmentIfc
- Returns:
- The rate at the time that the time interval begins
-
getRateAtUpperTimeLimit
public double getRateAtUpperTimeLimit()
Description copied from interface:RateSegmentIfc
The rate at the time that the time interval ends- Specified by:
getRateAtUpperTimeLimit
in interfaceRateSegmentIfc
- Returns:
- The rate at the time that the time interval ends
-
getLowerTimeLimit
public double getLowerTimeLimit()
Description copied from interface:RateSegmentIfc
The lower time limit- Specified by:
getLowerTimeLimit
in interfaceRateSegmentIfc
- Returns:
- The lower time limit
-
getUpperTimeLimit
public double getUpperTimeLimit()
Description copied from interface:RateSegmentIfc
The upper time limit- Specified by:
getUpperTimeLimit
in interfaceRateSegmentIfc
- Returns:
- The upper time limit
-
getTimeWidth
public double getTimeWidth()
Description copied from interface:RateSegmentIfc
The width of the interval- Specified by:
getTimeWidth
in interfaceRateSegmentIfc
- Returns:
- The width of the interval
-
getCumulativeRateLowerLimit
public double getCumulativeRateLowerLimit()
Description copied from interface:RateSegmentIfc
The lower limit on the cumulative rate axis- Specified by:
getCumulativeRateLowerLimit
in interfaceRateSegmentIfc
- Returns:
- The lower limit on the cumulative rate axis
-
getCumulativeRateUpperLimit
public double getCumulativeRateUpperLimit()
Description copied from interface:RateSegmentIfc
The upper limit on the cumulative rate axis- Specified by:
getCumulativeRateUpperLimit
in interfaceRateSegmentIfc
- Returns:
- The upper limit on the cumulative rate axis
-
getCumulativeRateIntervalWidth
public double getCumulativeRateIntervalWidth()
Description copied from interface:RateSegmentIfc
The cumulative rate interval width- Specified by:
getCumulativeRateIntervalWidth
in interfaceRateSegmentIfc
- Returns:
- The cumulative rate interval width
-
getCumulativeRate
public double getCumulativeRate(double time)
Description copied from interface:RateSegmentIfc
Returns the value of the cumulative rate function for the interval given a value of time within that interval- Specified by:
getCumulativeRate
in 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:RateSegmentIfc
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 interfaceRateSegmentIfc
- Parameters:
cumRate
- the cumulative rate- Returns:
- the inverse of the cumulative rate function
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-