private void MeasureRun() { Random random = new Random(2014); ICreator creator = new StencilSpeciesArrCreator(random, 10, 10, new double[] { 0.25, 0.25, 0.25, 0.25 }); Evolution population = new Evolution(random, creator, 7, 64) { }; Console.WriteLine("Best: " + population.Best.ToString()); Console.WriteLine(); DateTime start = DateTime.Now; population.Feed(20000); Console.WriteLine(); Console.WriteLine("Runtime: " + (DateTime.Now - start).ToString()); Console.WriteLine("Best: " + population.Best.ToString()); }
void work() { //evolution = new Evolution(new Random(), new StencilSpeciesArrCreator(new Random(), 10, 10, new double[] { 0.25, 0.25, 0.25, 0.25 }), 7, 25) { }; //evolution = new Evolution(new Random(), new StencilSpeciesArrCreator(new Random(), 50, 50, new double[] { 0.25, 0.25, 0.25, 0.25 }), 1, 5) { }; evolution = new Evolution(new Random(), new StencilSpeciesArrCreator(new Random(), 10, 10, 4), 7, 25) { }; evolutionForView = (Evolution)evolution.Clone(); while (running) { evolution.Feed(42); evolutionForView = (Evolution)evolution.Clone(); //Thread.Sleep(1000); if (leapNow) { evolution.Leap(); leapNow = false; } } }