public override double nextValue()
        {
            double u;

            while ((u = basicRandomValue.nextValue()) <= Utils.EPSILON)
            {
                ;
            }
            return(-1.0 / lambda * Math.Log(u));
        }
        private double nextInteger()
        {
            double value = 0;

            for (int i = 0; i < param; i++)
            {
                value += -Math.Log(basicRandom.nextValue());
            }
            return(value);
        }
Exemple #3
0
        private double nextInteger()
        {
            forIntegerGenerate.Clear();
            Double x = 0;

            for (int i = 0; i < alpha + beta + 1; i++)
            {
                x = basicRandom.nextValue();
                int j = 0;
                while (j < forIntegerGenerate.Count && x > forIntegerGenerate[j])
                {
                    j++;
                }
                if (j < forIntegerGenerate.Count)
                {
                    forIntegerGenerate.Insert(j, x);
                }
                else
                {
                    forIntegerGenerate.Add(x);
                }
            }
            return(forIntegerGenerate[(int)alpha]);
        }
Exemple #4
0
 private double nextGaus()
 {
     return(System.Math.Sqrt(-2 * Math.Log(1 - brv1.nextValue())) * Math.Cos(2 * Math.PI * brv2.nextValue()));
 }
 public override double nextValue()
 {
     return(begin + (end - begin) * brv.nextValue());
 }