View Javadoc
1   package ch.qos.logback.classic.testUtil;
2   
3   import java.util.Random;
4   
5   public class Gaussian {
6   
7       Random random;
8   
9       double mean;
10      double variance;
11  
12      public Gaussian(double mean, double variance) {
13          this.random = new Random();
14          this.mean = mean;
15          this.variance = variance;
16      }
17  
18      public Gaussian(long seed, double mean, double variance) {
19          this.random = new Random(seed);
20          this.mean = mean;
21          this.variance = variance;
22      }
23  
24      public double getGaussian() {
25          return mean + random.nextGaussian() * variance;
26      }
27  
28  }