// This method calculates the fitness for a given genotype.
        private static java.lang.Double eval(Genotype gt)
        {
            double x = ((DoubleGene)gt.getGene()).doubleValue();

            double y = Math.Cos(0.5 + Math.Sin(x)) * Math.Cos(x);

            return new java.lang.Double(y);
        }