public class PiecewiseLinear extends AbstractContinousDistribution
The cumulative distribution function (cdf) maps the accumulated range of source intervals to the accumulated range of target intervals times scale plus shift.
randomGenerator
Constructor and Description |
---|
PiecewiseLinear(double scale,
double shift,
MersenneTwisterFast random)
Constructs a new
PiecewiseLinear distribution. |
PiecewiseLinear(MersenneTwisterFast random)
Constructs a new
PiecewiseLinear distribution with neutral shift
(1) and scale (0). |
Modifier and Type | Method and Description |
---|---|
boolean |
addInterval(double sourceIntervalMax,
double targetIntervalMax)
Adds an interval spanning from the maximum value of the previous interval
to the given, mapping from source to target.
|
double |
evaluateCdf(double x)
Evaluates cumulative distribution function for this distribution.
|
double |
getScale() |
double |
getShift() |
double |
nextDouble() |
void |
setScale(double scale) |
void |
setShift(double shift) |
String |
toString() |
apply, apply, getRandomGenerator, nextInt, setRandomGenerator
public PiecewiseLinear(double scale, double shift, MersenneTwisterFast random)
PiecewiseLinear
distribution.scale
- the scale of returned valuesshift
- the shift of returned valuesrandom
- the random number generator to be usedpublic PiecewiseLinear(MersenneTwisterFast random)
PiecewiseLinear
distribution with neutral shift
(1) and scale (0).random
- the random number generator to be usedpublic boolean addInterval(double sourceIntervalMax, double targetIntervalMax)
sourceIntervalMax
- targetIntervalMax
- Collection.add(E)
)public double evaluateCdf(double x)
x
- public double getScale()
public void setScale(double scale)
public double getShift()
public void setShift(double shift)
public double nextDouble()
nextDouble
in class AbstractDistribution