Beispiel #1
0
        private static (Game, IList <Coords>) FindNumberphile(int chromosomeNum, double mutationProb, double crossoverProb, double keepBestRation = 0.2, double newGenerationRation = 0.2, int maxIteration = 1000)
        {
            var sw = new Stopwatch();

            sw.Start();

            var numberphileFinder = new NumberphileFinder();
            var game = numberphileFinder.FindNumberphile(chromosomeNum, mutationProb, crossoverProb, keepBestRation, newGenerationRation, maxIteration);

            sw.Stop();
            var time = sw.Elapsed;

            //Console.WriteLine($"stopwatch={time}");
            Debug.WriteLine($"chromosomeNum={chromosomeNum}, Fitness={numberphileFinder.Fitness(game.Item1)}, time={time}");
            return(game);
        }
Beispiel #2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     _numberphileFinder = new NumberphileFinder();
 }