public Engine(ExperimentParameters experimentParameters, IBenchmark benchmark, ConstraintsBuilderBase constraintsBuilder, IProcessor <Point[]> pointsNormalizer, IProcessor <Constraint[]> redundantConstraintsRemover, IAngleCalculator meanAngleCalculator, Stopwatch stoper)
        {
            Parameters                   = experimentParameters;
            Benchmark                    = benchmark;
            _constraintsBuilder          = constraintsBuilder;
            _redundantConstraintsRemover = redundantConstraintsRemover;
            _stoper = stoper;
            _meanAngleCalculator     = meanAngleCalculator;
            _pointsNormalizer        = pointsNormalizer;
            Statistics               = new Statistics();
            EvolutionSteps           = new List <IList <Constraint> >();
            NormalizedEvolutionSteps = new List <IList <Constraint> >();

            MersenneTwister.Initialize(experimentParameters.Seed);

            //var normalDis = new NormalDistribution();

            //const int count = int.MaxValue / 1000;
            //var values = new double[count];
            //////var sum = 0.0;
            //for (int i = 0; i < count; i++)
            //{
            //    values[i] = MersenneTwister.Instance.NextGaussian();
            //}
            ////values = normalDis.Generate(count);

            //var mean = values.Mean();
            //var stdDev = values.StandardDeviation();
        }
Ejemplo n.º 2
0
 public void Log(Statistics statistics)
 {
     _logBuilder.AppendLine("=================== STATISTICS =====================");
     _logBuilder.AppendPrintable(statistics.EvolutionStatistics);
     _logBuilder.AppendPrintable(statistics);
     _logBuilder.AppendLine("====================================================");
 }
Ejemplo n.º 3
0
 public void Insert(Statistics statistics)
 {
     Insert(statistics, _experiments, _statistics);
 }