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