Beispiel #1
0
        public int NextInt(int lower, int upper)
        {
            // [ lower; upper [ --> [ lower; upper ]
            Assert(lower < upper, "lower range cannot be bigger then upper range!");

            return((int)((uint32)(RNG_XORShift.Xorshift128Plus(ref _seedBuffer))
                         % (uint32)(Math.Abs(upper - lower + 1))
                         + lower));
        }
Beispiel #2
0
 public void ReSeed()
 {
     RNG_XORShift.XorshiftPlusJump(ref _seedBuffer);
 }
Beispiel #3
0
 public uint32 NextUInt32(uint32 range)
 {
     // [ 0; range [ --> [ 0; range ]
     return((uint32)(RNG_XORShift.Xorshift128Plus(ref _seedBuffer) % (range + 1)));
 }
Beispiel #4
0
 public uint64 NextUInt64()
 {
     return(RNG_XORShift.Xorshift128Plus(ref _seedBuffer));
 }