/// <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); } }
public void TestIntRange() { var rnd = new MersenneTwisterGenerateRandom(1); foreach (int aIntRangeTest in IntRangeTest) { int g = rnd.NextInt(0, 10); Assert.AreEqual(g, aIntRangeTest); } }
public void TestInt() { var rnd = new MersenneTwisterGenerateRandom(1); foreach (int aIntTest in IntTest) { int g = rnd.NextInt(); Assert.AreEqual(g, aIntTest, AIFH.DefaultPrecision); } }