Package toxi.util.datatypes
Class BiasedIntegerRange
java.lang.Object
toxi.util.datatypes.IntegerRange
toxi.util.datatypes.BiasedIntegerRange
-
Field Summary
Fields inherited from class toxi.util.datatypes.IntegerRange
currValue, max, min
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
int
getBias()
float
int
void
setBias
(int bias) void
setStandardDeviation
(float sd) toString()
Methods inherited from class toxi.util.datatypes.IntegerRange
adjustCurrentBy, fromSamples, fromSamples, getAt, getCurrent, getMedian, getRange, isValueInRange, seed, setCurrent, setRandom, toArray
-
Field Details
-
bias
public int bias -
standardDeviation
public float standardDeviation
-
-
Constructor Details
-
BiasedIntegerRange
public BiasedIntegerRange() -
BiasedIntegerRange
public BiasedIntegerRange(int min, int max, int bias, float 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 means sd=1.0, the entire range will be covered)
-
-
Method Details
-
copy
- Overrides:
copy
in classIntegerRange
-
getBias
public int getBias()- Returns:
- the bias
-
getStandardDeviation
public float getStandardDeviation()- Returns:
- the standardDeviation
-
pickRandom
public int pickRandom()- Overrides:
pickRandom
in classIntegerRange
-
setBias
public void setBias(int bias) - Parameters:
bias
- the bias to set
-
setStandardDeviation
public void setStandardDeviation(float sd) - Parameters:
sd
- the standardDeviation to set
-
toString
- Overrides:
toString
in classIntegerRange
-