예제 #1
0
        /// <summary>
        ///     Place the cities in random locations.
        /// </summary>
        private void InitCities()
        {
            IGenerateRandom rnd = new MersenneTwisterGenerateRandom();

            _cities = new City[Cities];
            for (int i = 0; i < _cities.Length; i++)
            {
                int xPos = rnd.NextInt(MapSize);
                int yPos = rnd.NextInt(MapSize);

                _cities[i] = new City(xPos, yPos);
            }
        }
예제 #2
0
        public void TestIntRange()
        {
            var rnd = new MersenneTwisterGenerateRandom(1);

            foreach (int aIntRangeTest in IntRangeTest)
            {
                int g = rnd.NextInt(0, 10);
                Assert.AreEqual(g, aIntRangeTest);
            }
        }
예제 #3
0
        public void TestInt()
        {
            var rnd = new MersenneTwisterGenerateRandom(1);

            foreach (int aIntTest in IntTest)
            {
                int g = rnd.NextInt();
                Assert.AreEqual(g, aIntTest, AIFH.DefaultPrecision);
            }
        }