public override Genome Start()
        {
            int    cursorPosition = Console.CursorTop;
            int    i           = 0;
            int    lastFound   = 0;
            int    howManyDies = (int)(Settings.Mortality * Settings.PopulationSize);
            Genome lastBest    = new Genome(null);

            RandomPopulation();
            Console.Write(i + " iteration. Current best: ");
            Program.PrintParameters(BestGenome.Genes);
            Console.Write("with fitness: " + BestGenome.Fitness.ToString("G10"));

            while (BestGenome.Fitness > Settings.MinError && i++ - lastFound < Settings.MaxNoChange && i < Settings.MaxIter)
            {
                lastBest.Copy(BestGenome);
                for (int j = 0; j < howManyDies; j++)
                {
                    ThreeTournament(j);
                }
                //Parallel.For(0, howManyDies, ThreeTournament);
                DetermineBestFitness();
                if (!(BestGenome.Fitness < lastBest.Fitness))
                {
                    continue;
                }
                lastFound = i;
                IoHandler.ClearCurrentConsoleLine(cursorPosition);
                Console.Write(i + " iteration. Current best: ");
                Program.PrintParameters(BestGenome.Genes);
                Console.Write("with fitness: " + BestGenome.Fitness.ToString("G10"));
            }
            return(BestGenome);
        }
        public override Genome Start()
        {
            int    cursorPosition = Console.CursorTop;
            int    i         = 0;
            int    lastFound = 0;
            Genome lastBest  = new Genome(null);

            RandomPopulation();
            Console.Write(i + " iteration. Current best: ");
            Program.PrintParameters(BestGenome.Genes);
            Console.Write("with fitness: " + BestGenome.Fitness.ToString("G10"));
            while (BestGenome.Fitness > Settings.MinError && lastFound < Settings.MaxNoChange && i++ < Settings.MaxIter)
            {
                lastBest.Copy(BestGenome);
                _tempPopulation[0].Copy(BestGenome);
                double unused = CalculateFitness();
                Parallel.For(1, Settings.PopulationSize, SingleThread);
                SwapBuffers();
                DeterminePopulationFitness();
                if (!(BestGenome.Fitness < lastBest.Fitness))
                {
                    continue;
                }
                lastFound = i;
                IoHandler.ClearCurrentConsoleLine(cursorPosition);
                Console.Write(i + " iteration. Current best: ");
                Program.PrintParameters(BestGenome.Genes);
                Console.Write("with fitness: " + BestGenome.Fitness.ToString("G10"));
            }
            return(BestGenome);
        }