NextInt() public method

Generates a random int over the range 0 to int.MaxValue, inclusive. This method differs from Next() only in that the range is 0 to int.MaxValue and not 0 to int.MaxValue-1. The slight difference in range means this method is slightly faster than Next() but is not functionally equivalent to System.Random.Next().
public NextInt ( ) : int
return int
コード例 #1
0
ファイル: FastRandom.cs プロジェクト: pablogps/CrowdAI
        /// <summary>
        /// Initialises a new instance using a seed generated from the class's static seed RNG.
        /// </summary>
        public FastRandom()
        {
            DisplaySeed();
            int nextSeed = __seedRng.NextInt();

            // Reinitialise(__seedRng.NextInt());
            Reinitialise(nextSeed);
        }
コード例 #2
0
        /// <summary>
        /// Initialises a new instance using a seed generated from the class's static seed RNG.
        /// </summary>
        public FastRandom()
        {
            int nextSeed = __seedRng.NextInt();

            // Reinitialise(__seedRng.NextInt());
            Reinitialise(nextSeed);
            //UnityEngine.Debug.Log("FastRandom original seed " + seed0);
            //UnityEngine.Debug.Log("FastRandom initialize seed " + nextSeed);
        }
コード例 #3
0
ファイル: FastRandom.cs プロジェクト: rinde/NeatSim
 /// <summary>
 /// Initialises a new instance using a seed generated from the class's static seed RNG.
 /// </summary>
 public FastRandom()
 {
     Reinitialise(__seedRng.NextInt());
 }