diff --git a/src/main/java/com/samskivert/util/Randoms.java b/src/main/java/com/samskivert/util/Randoms.java index f82593da..747681b1 100644 --- a/src/main/java/com/samskivert/util/Randoms.java +++ b/src/main/java/com/samskivert/util/Randoms.java @@ -126,13 +126,22 @@ public class Randoms } /** - * Returns true or false with approximately even probability. + * Returns true or false with approximately even probability. */ public boolean getBoolean () { return _r.nextBoolean(); } + /** + * Returns a pseudorandom, normally distributed float value around the + * mean with the standard deviation dev. + */ + public float getNormal (float mean, float dev) + { + return (float)_r.nextGaussian() * dev + mean; + } + /** * Returns a key from the supplied map according to a probability computed as * the key's value divided by the total of all the key's values.