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

Recombine() защищенный статический Метод

Swap parts of two chromosomes.

The method performs interchanging of genes between two chromosomes starting from the point position.

protected static Recombine ( IGPGene src1, IGPGene src2, int point, int length ) : void
src1 IGPGene First chromosome participating in genes' interchange.
src2 IGPGene Second chromosome participating in genes' interchange.
point int Index of the first gene in the interchange sequence.
length int Length of the interchange sequence - number of genes /// to interchange.
Результат void
		protected static void Recombine( IGPGene[] src1, IGPGene[] src2, int point, int length )
		{
			// temporary array
			IGPGene[] temp = new IGPGene[length];

			// copy part of first chromosome to temp
			Array.Copy( src1, point, temp, 0, length );
			// copy part of second chromosome to the first
			Array.Copy( src2, point, src1, point, length );
			// copy temp to the second
			Array.Copy( temp, 0, src2, point, length );
		}
	}