public class CurvedBoundedDistribution extends IDistribution.SimpleDistribution implements IDistribution
IRNG.nextDouble() to make and average
whenever a double is requested. When this parameter degree is 1, this is uniform; when it is 2, this is a
triangular distribution, and when it is 3 or more it is an increasingly centralized bell curve. The average value is
always very close to 0.5, and the bounds are the same as IRNG.nextDouble().
IDistribution.SimpleDistribution| Modifier and Type | Field and Description |
|---|---|
static CurvedBoundedDistribution |
instance |
static CurvedBoundedDistribution |
instanceGaussianLike |
static CurvedBoundedDistribution |
instanceTriangular |
EXCLUSIVE_ONE, EXCLUSIVE_ZERO| Constructor and Description |
|---|
CurvedBoundedDistribution() |
CurvedBoundedDistribution(int degree) |
| Modifier and Type | Method and Description |
|---|---|
int |
getDegree() |
double |
getMean()
Gets the mean value of this distribution (0.5).
|
double |
nextDouble(IRNG rng)
Gets a double between
IDistribution.getLowerBound() and IDistribution.getUpperBound() that obeys this distribution. |
void |
setDegree(int degree) |
clampedDistribution, fractionalDistribution, fractionalOffsetDistribution, getLowerBound, getUpperBoundclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLowerBound, getUpperBoundpublic static final CurvedBoundedDistribution instance
public static final CurvedBoundedDistribution instanceTriangular
public static final CurvedBoundedDistribution instanceGaussianLike
public CurvedBoundedDistribution()
public CurvedBoundedDistribution(int degree)
public int getDegree()
public void setDegree(int degree)
public double nextDouble(IRNG rng)
IDistributionIDistribution.getLowerBound() and IDistribution.getUpperBound() that obeys this distribution.nextDouble in interface IDistributionrng - an IRNG, such as RNG or GWTRNG, that this will get one or more random numbers fromIDistribution.getLowerBound() and IDistribution.getUpperBound(), both inclusivepublic double getMean()
getMean in interface IDistributiongetMean in class IDistribution.SimpleDistributionCopyright © Eben Howard 2012–2022. All rights reserved.