Here you can find the source of gaussianInt(Random random, int min, int max)
public static int gaussianInt(Random random, int min, int max)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { private static final double GAUSSIAN_LIMIT = 3.0d; public static int gaussianInt(Random random, int min, int max) { if (max < min) { throw new IllegalArgumentException("max < min"); }//from ww w . j a v a 2s . c o m double det = (random.nextGaussian() + GAUSSIAN_LIMIT) / GAUSSIAN_LIMIT / 2.0d; return min + (int) (det * (max - min)); } }