public NroRandom multiplicativo(int x)
        {
            int       xi     = (a * x) % m;
            NroRandom nroRnd = new NroRandom(x, xi, dividir(xi));

            return(nroRnd);
        }
        public NroRandom lineal(int x)
        {
            int       xi     = (a * x + c) % m;
            NroRandom nroRnd = new NroRandom(x, xi, dividir(xi));

            return(nroRnd);
        }
Пример #3
0
        public NroRandom lenguaje()
        {
            //Random random = new Random();
            double    nro    = Math.Round(random.NextDouble(), 4, MidpointRounding.AwayFromZero);
            NroRandom nroRnd = new NroRandom(0, 0, nro);

            return(nroRnd);
        }
Пример #4
0
        public NroRandom multiplicativo(int x)
        {
            int       a      = 3 + (8 * k);
            double    m      = Math.Pow(2, g);
            int       xi     = Convert.ToInt32((a * x) % m);
            NroRandom nroRnd = new NroRandom(x, xi, dividir(xi, m));

            return(nroRnd);
        }
Пример #5
0
        public NroRandom lineal(int x)
        {
            int       a      = 1 + (4 * k);
            double    m      = Math.Pow(2, g);
            int       xi     = Convert.ToInt32((a * x + c) % m);
            NroRandom nroRnd = new NroRandom(x, xi, dividir(xi, m));

            return(nroRnd);
        }
Пример #6
0
 public NroRandom multiplicativo(int x)
 {
     //X𝑛+1 ≡ (𝑎 ∙ 𝑥𝑛)𝑚𝑜𝑑 m
     int a = 3 + (8 * k);
     double m = Math.Pow(2, g);
     int xi = Convert.ToInt32((a * x) % m);
     NroRandom nroRnd = new NroRandom(x, xi, dividir(xi, m));
     return nroRnd;
 }
Пример #7
0
 public NroRandom mixto(int x)
 {
     //𝑥𝑛+1 ≡ (𝑎 ∙ 𝑥𝑛 + 𝑐)𝑚𝑜𝑑 m
     int a = 1 + (4 * k);
     double m = Math.Pow(2, g);
     int xi = Convert.ToInt32((a * x + c) % m);
     NroRandom nroRnd = new NroRandom(x, xi, dividir(xi, m));
     return nroRnd;
 }
Пример #8
0
 public NroRandom lenguaje()
 {
     double nro = truncarACuatro(random.NextDouble());
     NroRandom nroRnd = new NroRandom(0, 0, nro);
     return nroRnd;
 }