Evolution/Evolution/Genotypes/ListGenotype.cs
/// <summary>
/// Gets a copy of the genotype with genes at positions i and j swaped
/// </summary>
/// <param name="i">One gene</param>
/// <param name="j">The other gene</param>
/// <returns></returns>
Gets a copy of the genotype with genes at positions i and j swaped
Gets a copy of the genotype with genes at positions i and j swaped
public ListGenotype<G> Swap(int i, int j)
        {
            List<G> res = new List<G>(genesList);
            G t = res[i];
            res[i] = res[j];
            res[j] = t;
            return new ListGenotype<G>(res);
        }
public ListGenotype < G > Swap ( int i , int j ) { List < G > res = new List < G > ( genesList ) ; G t = res [ i ] ; res [ i ] = res [ j ] ; res [ j ] = t ; return new ListGenotype < G > ( res ) ; }
Gets a copy of the genotype with genes at positions i and j swaped
Gets a copy of the genotype with genes at positions i and j swaped
None
i
int
None
j
int
The other gene
The other gene