Ejemplo n.º 1
0
 public Generation(int populationSize, int generationNumber,
                   ICache <GeneKey, GeneValue> cache)
 {
     this.populationSize   = populationSize;
     this.generationNumber = generationNumber;
     this.cache            = cache;
     generationFitnesses   = new GenerationFitnesses <GeneKey, GeneValue>();
     population            = new List <IIndividual <GeneKey, GeneValue> >();
 }
Ejemplo n.º 2
0
 public Generation(IIndividual <GeneKey, GeneValue> individual, int populationSize,
                   ICache <GeneKey, GeneValue> cache)
 {
     this.populationSize   = populationSize;
     this.generationNumber = 1;
     this.cache            = cache;
     population            = new List <IIndividual <GeneKey, GeneValue> >();
     generationFitnesses   = new GenerationFitnesses <GeneKey, GeneValue>();
     population.Add(individual);
     FillPopulation();
 }