public Population(int size, Chromosomes.IChromosomeFactory chromosomeFactory, FitnessFunctions.IFitnessFunction fitnessFunction, SelectionMethods.ISelectionMethod selectionMethod) { this.SetCrossoverProbabilityToDefault(); this.SetMutationProbabilityToDefault(); this.SetSelectionRateToDefault(); this.size = size; this.individuals = new Chromosomes.IChromosome[size]; for (int i = 0; i < size; ++i) this.individuals[i] = chromosomeFactory.GetNewChromosome(); this.fitnessCalculator = fitnessFunction; this.selector = selectionMethod; this.fitnesses = new double[this.size]; for (int i = 0; i < this.size; ++i) this.fitnesses[i] = this.fitnessCalculator.GetFitness(this.individuals[i]); }