Exemplo n.º 1
0
 /// <summary>
 /// Produce a uniform random sample from the open interval (min, max). The method can return
 /// either end point.
 /// </summary>
 /// <param name="min">Min (exclusive)</param>
 /// <param name="max">Max (exclusive)</param>
 /// <returns>Random Sample.</returns>
 public static int GetUniform(int min, int max)
 {
     return((int)Sampling.GetUniform((double)min, (double)max));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Produce a uniform random sample from the open interval (min, max inclusive). The method can return
 /// either end point
 /// </summary>
 /// <param name="min"></param>
 /// <param name="max"></param>
 /// <returns></returns>
 public static double GetUniform(double min = 0d, double max = 1.0d)
 {
     return((min + (Sampling.GetUniform() * ((max - min) + 1d))).Clip(min, max));
 }