예제 #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());
 }
예제 #2
0
 // 2.) Definition of the fitness function.
 private static int Eval(Genotype <BitGene> gt)
 {
     return(gt.GetChromosome().As <BitChromosome>().BitCount());
 }
예제 #3
0
 private static int Count(Genotype <BitGene> gt)
 {
     return(((BitChromosome)gt.GetChromosome()).BitCount());
 }