Esempio n. 1
0
        static double Run(ArrayChromosome<double> argument)
        {
            var Sunder = new List<WeightedMetric>();
            for (int i = 0; i < functions.Count; i++)
                Sunder.Add(new WeightedMetric(functions[i], argument.Code[i]));

            var result = maps.Select(z => Run(z, Sunder)).ToArray();
            for (int i = 0; i < result.Length; i++)
                result[i] /= baseline[i];
            return result.Average();
        }
Esempio n. 2
0
 static string Print(ArrayChromosome<double> argument)
 {
     var sum = argument.Code.Select(z=>Math.Abs(z)).Sum();
     return argument.Code.Select(z => Math.Round(z/sum, 3).ToString()).Aggregate((a, b) => a + " " + b);
 }