Exemplo n.º 1
0
 private void DieOfAge(int maxAge)
 {
     if (PopulationList.Exists(x => x.Age > maxAge))
     {
         PopulationList = PopulationList.OrderBy(x => x.Age).ToList();
         NeuronNet firstOld = PopulationList.First(x => x.Age > maxAge);
         int       index    = PopulationList.IndexOf(firstOld);
         PopulationList.RemoveRange(index, PopulationList.Count - index);
         PopulationList = PopulationList.OrderBy(x => x.Error).ToList();
     }
 }
Exemplo n.º 2
0
 private void SortPopulation()
 {
     PopulationList = PopulationList.OrderBy(x => x.Error).ToList();
 }