Esempio n. 1
0
 public ArithmeticSpecimen(ArithmeticSpecimen parent1, ArithmeticSpecimen parent2)
 {
     fittingFunction = parent1.fittingFunction;
     Genes           = new double[parent1.Genes.Length];
     for (int i = 0; i < Genes.Length; i++)
     {
         Genes[i] = (parent1.Genes[i] + parent2.Genes[i]) / 2;
     }
 }
Esempio n. 2
0
        private double GetResultOfFitFunctionForMultidimensionalFucntion(ArithmeticSpecimen s)
        {
            double result = 0;

            for (int i = 1; i < s.Genes.Length; i++)
            {
                result += (Math.Pow(1 - s.Genes[i - 1], 2)) + (100 * Math.Pow(s.Genes[i] - Math.Pow(s.Genes[i - 1], 2), 2)); // Rosenbrock Function (Multidimensional)
            }

            return(result);
        }