예제 #1
0
        public override Evaluation GetEvaluation(double correctValue)
        {
            var meanValue   = Readings.Average(x => x.Value);
            var meanMistake = Math.Abs(meanValue - correctValue);

            var    standardDeviation = Math.Sqrt(Readings.Sum(x => Math.Pow(meanValue - x.Value, 2)) / (Readings.Count - 1));
            string result;

            if (meanMistake > 0.5)
            {
                result = "precise";
            }
            else if (standardDeviation > 3)
            {
                result = "very precise";
            }
            else
            {
                result = "ultra precise";
            }

            return(new Evaluation(Name, result));
        }