Package squidpony.squidmath
Class SpikeDistribution.SimpleSpikeDistribution
java.lang.Object
squidpony.squidmath.IDistribution.SimpleDistribution
squidpony.squidmath.SpikeDistribution.SimpleSpikeDistribution
- All Implemented Interfaces:
IDistribution
- Enclosing class:
- SpikeDistribution
public static class SpikeDistribution.SimpleSpikeDistribution extends IDistribution.SimpleDistribution implements IDistribution
A variant on SpikeDistribution that has its range shrunk and moved from
[-1,1)
to [0,1)
. It is a
IDistribution.SimpleDistribution
, and the spike is centered on 0.5.-
Nested Class Summary
Nested classes/interfaces inherited from interface squidpony.squidmath.IDistribution
IDistribution.SimpleDistribution
-
Constructor Summary
Constructors Constructor Description SimpleSpikeDistribution()
-
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
-
Constructor Details
-
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()
-