@API(status=EXPERIMENTAL,
since="1.3.0")
public interface RandomDistribution
Since all random numeric value generation is going back to BigDecimal generation this interfaces uses only values of type BigDecimal.
The generation of an arbitrary's edge cases is not influenced by the distribution.
Modifier and Type | Interface and Description |
---|---|
static class |
RandomDistribution.RandomDistributionFacade |
static interface |
RandomDistribution.RandomNumericGenerator
Generator for BigInteger values which are behind all generated numeric values in jqwik.
|
Modifier and Type | Method and Description |
---|---|
static RandomDistribution |
biased()
A distribution that generates values closer to the center of a numerical range
with a higher probability.
|
RandomDistribution.RandomNumericGenerator |
createGenerator(int genSize,
java.math.BigInteger min,
java.math.BigInteger max,
java.math.BigInteger center)
Return a generator that will generate value with the desired distribution
|
static RandomDistribution |
gaussian()
A gaussian distribution with
borderSigma of 3,
i.e. approximately 99.7% of values are within the borders. |
static RandomDistribution |
gaussian(double borderSigma)
A distribution that generates values with (potentially asymmetric) gaussian distribution
the mean of which is the specified center and the probability at the borders is
approximately
borderSigma times standard deviation. |
static RandomDistribution |
uniform()
A distribution that generates values across the allowed range
with a uniform probability distribution.
|
static RandomDistribution biased()
static RandomDistribution uniform()
static RandomDistribution gaussian(double borderSigma)
borderSigma
times standard deviation.
Gaussian generation is approximately 10 times slower than biased() or uniform() generation. But still, except in rare cases this will not make a noticeable difference in the runtime of your properties.
borderSigma
- The approximate factor of standard deviation at the border(s)static RandomDistribution gaussian()
borderSigma
of 3,
i.e. approximately 99.7% of values are within the borders.gaussian(double)
RandomDistribution.RandomNumericGenerator createGenerator(int genSize, java.math.BigInteger min, java.math.BigInteger max, java.math.BigInteger center)
genSize
- The approximate number of values to generate. Can be influenced by callers.min
- The minimum allowed value (included)max
- The maximum allowed value (included)center
- The center for the distribution. Must be within min and max.