Package net.jqwik.api

Interface RandomDistribution

    • Method Detail

      • biased

        static RandomDistribution biased()
        A distribution that generates values closer to the center of a numerical range with a higher probability. The bigger the range the stronger the bias.
        Returns:
        a random distribution instance
      • uniform

        static RandomDistribution uniform()
        A distribution that generates values across the allowed range with a uniform probability distribution.
        Returns:
        a random distribution instance
      • gaussian

        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.

        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.

        Parameters:
        borderSigma - The approximate factor of standard deviation at the border(s)
        Returns:
        a random distribution instance
      • gaussian

        static RandomDistribution gaussian()
        A gaussian distribution with borderSigma of 3, i.e. approximately 99.7% of values are within the borders.
        Returns:
        a random distribution instance
        See Also:
        gaussian(double)
      • createGenerator

        @API(status=INTERNAL)
        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
        Parameters:
        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.
        Returns:
        generator for randomly generated BigInteger values