/// <summary> /// Adds the given genomes to the generation /// </summary> /// <param name="Genomes"></param> /// <returns>Count of individuals</returns> public int AddGenomes(List <string> Genomes) { foreach (var genome in Genomes) { AddGenome(genome); } return(Individuals.Count()); }
public double[] ToArray() { int num_individuals = Individuals.Count(); double[] res = new double[num_individuals * num_variables + 2]; int pos = 2; res[0] = num_individuals; res[1] = num_variables; for (int i = 0; i < num_individuals; i++) { Individual ind = individuals.ElementAt(i); for (int j = 0; j < num_variables; j++) { res[pos++] = ind[j]; } } return(res); }
private Guid GetIdOfRandomChromosome() { return(Individuals[Random.Next() % Individuals.Count()].Id); }