Accord.Genetic.Population.AddChromosome C# (CSharp) Method

AddChromosome() public method

Add chromosome to the population.

The method adds specified chromosome to the current population. Manual adding of chromosome maybe useful, when it is required to add some initialized chromosomes instead of random.

Adding chromosome manually should be done very carefully, since it may break the population. The manually added chromosome must have the same type and initialization parameters as the ancestor passed to constructor.

public AddChromosome ( IChromosome chromosome ) : void
chromosome IChromosome Chromosome to add to the population.
return void
        public void AddChromosome(IChromosome chromosome)
        {
            chromosome.Evaluate(fitnessFunction);
            population.Add(chromosome);
        }