Esempio n. 1
0
        // Select N random items from coll, with replacement.
        // Does not modify the given list.

        public static SCG.IEnumerable <T> RandomWith <T>(IIndexed <T> coll, int N)
        {
            for (int i = N; i > 0; i--)
            {
                T x = coll[rnd.Next(coll.Count)];
                yield return(x);
            }
        }
Esempio n. 2
0
        public string RandomHexStr()
        {
            C5Random rdm      = getRandom2;
            string   hexValue = string.Empty;
            int      num;

            num      = rdm.Next(8, 101);
            hexValue = num.ToString("X2");
            return(hexValue);
        }
Esempio n. 3
0
 public static Point Random(int w, int h)
 {
     return(new Point(rnd.Next(w), rnd.Next(h)));
 }
Esempio n. 4
0
 private TimeSpan RandomizeClusterAutoDiscoveryStartDelay()
 => routeDiscoveryConfig.ClusterAutoDiscoveryStartDelay
 .MultiplyBy(randomizer.Next(1, routeDiscoveryConfig.ClusterAutoDiscoveryStartDelayMaxMultiplier));
Esempio n. 5
0
 public static Point Random(int w, int h) => new Point(rnd.Next(w), rnd.Next(h));