Exemplo n.º 1
0
        public CMTRandom(string tag, CEncodedObjectInputBufferI bin)
        {
            bin.nextTag(tag);
            Dictionary <string, string> attr = bin.getAttributes();
            //with seeded constructor, run use count up to appropriate total
            int useCount = EncodeUtil.parseInt(attr[USE_COUNT_ATTR]);

            seedUsed_ = ulong.Parse(bin.getObjectText(SEED_TAG));
            twister_  = new CMersenneTwister(seedUsed_);
            for (int i = 0; i < useCount; i++)
            {
                random(2);
            }
            bin.endTag(tag);
        }
Exemplo n.º 2
0
 public CMTRandom()
 {
     seedUsed_ = currentTimeMillis();
     twister_  = new CMersenneTwister(seedUsed_);
 }
Exemplo n.º 3
0
 public CMTRandom(ulong value)
 {
     seedUsed_ = value;
     twister_  = new CMersenneTwister(seedUsed_);
 }