Package toxi.util.datatypes
Class BiasedDoubleRange
java.lang.Object
toxi.util.datatypes.DoubleRange
toxi.util.datatypes.BiasedDoubleRange
-
Field Summary
Fields inherited from class toxi.util.datatypes.DoubleRange
currValue, max, min
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
double
getBias()
double
double
void
setBias
(double bias) void
setStandardDeviation
(double sd) toString()
Methods inherited from class toxi.util.datatypes.DoubleRange
adjustCurrentBy, fromSamples, fromSamples, getAt, getCurrent, getMedian, getRange, isValueInRange, seed, setCurrent, setRandom, toArray
-
Constructor Details
-
BiasedDoubleRange
public BiasedDoubleRange() -
BiasedDoubleRange
public BiasedDoubleRange(double min, double max, double bias, double sd) - Parameters:
min
- min value (inclusive)max
- max value (inclusive)bias
- bias value (can be outside the min/max range, but values will be clipped)sd
- standard deviation (if bias at range mean sd=1.0, the entire range will be covered)
-
-
Method Details
-
copy
- Overrides:
copy
in classDoubleRange
-
getBias
public double getBias()- Returns:
- the bias
-
getStandardDeviation
public double getStandardDeviation()- Returns:
- the standardDeviation
-
pickRandom
public double pickRandom()- Overrides:
pickRandom
in classDoubleRange
-
setBias
public void setBias(double bias) - Parameters:
bias
- the bias to set
-
setStandardDeviation
public void setStandardDeviation(double sd) - Parameters:
sd
- the standardDeviation to set
-
toString
- Overrides:
toString
in classDoubleRange
-