Package squidpony.squidmath
Class BathtubDistribution
java.lang.Object
squidpony.squidmath.IDistribution.SimpleDistribution
squidpony.squidmath.BathtubDistribution
- All Implemented Interfaces:
IDistribution
public class BathtubDistribution extends IDistribution.SimpleDistribution implements IDistribution
An IDistribution that produces results between 0.0 inclusive and 1.0 exclusive, but is much more likely to produce
results near 0.0 or 1.0, further from 0.5.
Created by Tommy Ettinger on 11/23/2019.
Created by Tommy Ettinger on 11/23/2019.
-
Nested Class Summary
Nested classes/interfaces inherited from interface squidpony.squidmath.IDistribution
IDistribution.SimpleDistribution
-
Field Summary
Fields Modifier and Type Field Description static BathtubDistribution
instance
-
Constructor Summary
Constructors Constructor Description BathtubDistribution()
-
Method Summary
Modifier and Type Method Description double
nextDouble(IRNG rng)
Gets a double betweenIDistribution.SimpleDistribution.getLowerBound()
andIDistribution.SimpleDistribution.getUpperBound()
that obeys this distribution.Methods inherited from class squidpony.squidmath.IDistribution.SimpleDistribution
clampedDistribution, fractionalDistribution, fractionalOffsetDistribution, getLowerBound, getUpperBound
-
Field Details
-
Constructor Details
-
BathtubDistribution
public BathtubDistribution()
-
-
Method Details
-
nextDouble
Gets a double betweenIDistribution.SimpleDistribution.getLowerBound()
andIDistribution.SimpleDistribution.getUpperBound()
that obeys this distribution.- Specified by:
nextDouble
in interfaceIDistribution
- Parameters:
rng
- an IRNG, such asRNG
orGWTRNG
, that this will get one or more random numbers from- Returns:
- a double within the range of
IDistribution.SimpleDistribution.getLowerBound()
andIDistribution.SimpleDistribution.getUpperBound()
-