Exemple #1
0
 private static int Length(Genotype <EnumGene <int> > genotype)
 {
     return(Enumerable.Range(1, genotype.GetChromosome().Length - 1)
            .Select(i => Dist(genotype.GetChromosome(), i, i - 1))
            .Sum());
 }
Exemple #2
0
 // 2.) Definition of the fitness function.
 private static int Eval(Genotype <BitGene> gt)
 {
     return(gt.GetChromosome().As <BitChromosome>().BitCount());
 }
Exemple #3
0
 private static int Count(Genotype <BitGene> gt)
 {
     return(((BitChromosome)gt.GetChromosome()).BitCount());
 }