[Quantproject-developers] QuantProject/b1_ADT/Optimizing/Genetic Genome.cs, 1.14, 1.15
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2007-01-03 22:56:53
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Optimizing/Genetic In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25929/b1_ADT/Optimizing/Genetic Modified Files: Genome.cs Log Message: HasGene method has been overloaded Index: Genome.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Optimizing/Genetic/Genome.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Genome.cs 22 Aug 2006 19:07:50 -0000 1.14 --- Genome.cs 3 Jan 2007 22:56:49 -0000 1.15 *************** *** 236,239 **** --- 236,253 ---- /// <summary> + /// It returns true if the given gene is already stored in the current genome + /// at the given genePosition + /// </summary> + /// <param name="genePosition">Gene position where the check + /// has to be done, inside the given genome</param> + public bool HasGene(int geneValue, int genePosition) + { + if(genePosition >= this.size) + throw new IndexOutOfRangeException("bad genePosition parameter!"); + + return geneValue == this.Genes()[genePosition]; + } + + /// <summary> /// It returns true if the current instance shares no gene with the given /// genome |