tools/stress/src/org/apache/cassandra/stress/util/Operation.java
/**
     * Gaussian distribution.
     * @param mu is the mean
     * @param sigma is the standard deviation
     *
     * @return next Gaussian distribution number
     */
Gaussian distribution.
@param mu is the mean
@param sigma is the standard deviation

@return next Gaussian distribution number
Gaussian distribution . @param mu is the mean @param sigma is the standard deviation @return next Gaussian distribution number
private static double nextGaussian(int mu, float sigma)
    {
        Random random = Stress.randomizer;
        Double currentState = nextGaussian;
        nextGaussian = null;
        if (currentState == null)
        {
            double x2pi  = random.nextDouble() * 2 * Math.PI;
            double g2rad = Math.sqrt(-2.0 * Math.log(1.0 - random.nextDouble()));
            currentState = Math.cos(x2pi) * g2rad;
            nextGaussian = Math.sin(x2pi) * g2rad;
        }
        return mu + currentState * sigma;
    }
private static double nextGaussian ( int mu , float sigma ) { Random random = Stress . randomizer ; Double currentState = nextGaussian ; nextGaussian = null ; if ( currentState == null ) { double x2pi = random . nextDouble ( ) * 2 * Math . PI ; double g2rad = Math . sqrt ( - 2.0 * Math . log ( 1.0 - random . nextDouble ( ) ) ) ; currentState = Math . cos ( x2pi ) * g2rad ; nextGaussian = Math . sin ( x2pi ) * g2rad ; } return mu + currentState * sigma ; }
Gaussian distribution.
Gaussian distribution .