public GeneticGeneration(int count, int genCount) { Chromosome = new Genetic.Chromosome[count]; for (int i = 0; i < count; i++) { Chromosome[i] = new Genetic.Chromosome(genCount); } }
public GeneticGeneration(Random generator, GeneticDataConfig cfg) { int count = cfg.ChromosomeCount; int genCount = cfg.GenCount; Chromosome = new Genetic.Chromosome[count]; for (int i = 0; i < count; i++) { Chromosome[i] = new Genetic.Chromosome(genCount); if (cfg.RandomInit == false) { continue; } for (int j = 0; j < genCount; j++) { double random = generator.Next((int)cfg.MinGen, (int)cfg.MaxGen); cfg.Floating(ref random, generator.NextDouble()); Chromosome[i].Gen[j] = random; } } }