AForge.Genetic.GEPChromosome.GEPChromosome C# (CSharp) Метод

GEPChromosome() публичный Метод

Initializes a new instance of the GEPChromosome class.

This constructor creates a randomly generated GEP chromosome, which has all genes of the same type and properties as the specified ancestor.

public GEPChromosome ( IGPGene ancestor, int headLength ) : System
ancestor IGPGene A gene, which is used as generator for the genetic tree.
headLength int Length of GEP chromosome's head (see ).
Результат System
		public GEPChromosome( IGPGene ancestor, int headLength )
		{
			// store head length
			this.headLength = headLength;
			// calculate chromosome's length
			length = headLength + headLength * ( ancestor.MaxArgumentsCount - 1 ) + 1;
			// allocate genes array
			genes = new IGPGene[length];
			// save ancestor as a temporary head
			genes[0] = ancestor;
			// generate the chromosome
			Generate( );
		}

Same methods

GEPChromosome::GEPChromosome ( GEPChromosome source ) : System