示例#1
0
 public void CreatePopulation()
 {
     for (int i = 0; i < PopSize; i++)
     {
         Populus.Add(new Individual());
     }
 }
示例#2
0
        public void GetFittest(int percentageNum)
        {
            int percentageCount = (percentageNum * PopSize) / 100;

            FittestPop = Populus.OrderByDescending(o => o.Fitness).Take(percentageCount).ToList();
            foreach (var item in FittestPop)
            {
                //Console.WriteLine($"{string.Join("", item.Genes)}, fitness: {item.Fitness}");
            }
        }