Exemplo n.º 1
0
 public void CopyIndividuals(Population population)
 {
     Individuals.Clear();
     foreach (Individual item in population.Individuals)
     {
         Individual tmp = new Individual();
         tmp.Copy(item);
         Individuals.Add(tmp);
     }
 }
Exemplo n.º 2
0
        public void Evolve()
        {
            var nextGen   = new List <Tree <T> >(MaxPop);
            var selection = Tournament();

            nextGen.AddRange(Crossover(selection));
            nextGen.AddRange(Mutate(selection));
            nextGen.AddRange(Elitism());
            nextGen.AddRange(RampedHalfNHalf(MaxPop - nextGen.Count, MaxDepth, Terminals, Functions, GrowTerminalChance));
            Individuals.Clear();
            Individuals = nextGen;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Sets all Individuals in the Subpopulation to null, preparing it to be reused.
 /// </summary>
 public void Clear()
 {
     Individuals.Clear();
 }
Exemplo n.º 4
0
 public virtual void Clear( ) => Individuals.Clear( );