Compute statistical measures in accumulating manner, incl. mean, variance, std.deviation, min, max.
示例#1
0
        /// <summary>
        /// Write fitness-trace to a TextWriter stream.
        /// </summary>
        public override void Write(TextWriter writer)
        {
            writer.WriteLine("Mean feasibility 0 means all solutions were infeasible.");
            writer.WriteLine("Mean feasibility 1 means all solutions were feasible.");
            writer.WriteLine();
            writer.WriteLine("# Iteration\tMean Feasibility");
            writer.WriteLine();

            for (int i = 0; i < Trace.Length; i++)
            {
                StatisticsAccumulator trace = Trace[i];

                if (trace.Count > 0)
                {
                    double mean = trace.Mean;

                    writer.WriteLine(
                        "{0} {1}",
                        Iteration(i),
                        Tools.FormatNumber(mean));
                }
                else
                {
                    break;
                }
            }

            writer.Close();
        }
示例#2
0
        /// <summary>
        /// Write fitness-trace to a TextWriter stream.
        /// </summary>
        public override void Write(TextWriter writer)
        {
            writer.WriteLine("# Iteration\tMean Fitness\tStdError\tMin\tMax");
            writer.WriteLine();

            for (int i = 0; i < Trace.Length; i++)
            {
                StatisticsAccumulator trace = Trace[i];

                if (trace.Count > 0)
                {
                    double mean   = trace.Mean;
                    double stdDev = trace.StandardDeviation;
                    double min    = trace.Min;
                    double max    = trace.Max;

                    writer.WriteLine(
                        "{0} {1} {2} {3} {4}",
                        Iteration(i),
                        Tools.FormatNumber(mean),
                        Tools.FormatNumber(stdDev),
                        Tools.FormatNumber(min),
                        Tools.FormatNumber(max));
                }
                else
                {
                    break;
                }
            }

            writer.Close();
        }
示例#3
0
 /// <summary>
 /// Construct a new object.
 /// </summary>
 /// <param name="numIterations">Number of iterations per optimization run.</param>
 /// <param name="numIntervals">Approximate number of intervals to show mean.</param>
 /// <param name="chainedFitnessTrace">Chained FitnessTrace object.</param>
 public FeasibleTrace(int numIterations, int numIntervals, FitnessTrace chainedFitnessTrace)
     : base(chainedFitnessTrace, numIterations, numIntervals, 0)
 {
     // Allocate trace.
     Trace = new StatisticsAccumulator[MaxIntervals];
     for (int i = 0; i < MaxIntervals; i++)
     {
         Trace[i] = new StatisticsAccumulator();
     }
 }
示例#4
0
 /// <summary>
 /// Construct a new object.
 /// </summary>
 /// <param name="numIterations">Number of iterations per optimization run.</param>
 /// <param name="numIntervals">Approximate number of intervals to show mean.</param>
 /// <param name="chainedFitnessTrace">Chained FitnessTrace object.</param>
 public FeasibleTrace(int numIterations, int numIntervals, FitnessTrace chainedFitnessTrace)
     : base(chainedFitnessTrace, numIterations, numIntervals, 0)
 {
     // Allocate trace.
     Trace = new StatisticsAccumulator[MaxIntervals];
     for (int i = 0; i < MaxIntervals; i++)
     {
         Trace[i] = new StatisticsAccumulator();
     }
 }