Beispiel #1
0
        private static IList <MeasuredConfiguration <Configuration> > PerformFullExploration(Configuration baseConfiguration, IBenchmark <Configuration> repBenchmark)
        {
            var counter      = 1;
            var measurements = new List <MeasuredConfiguration <Configuration> >();
            var keepLastLine = true;

            foreach (var config in baseConfiguration.GetAllPossibilities())
            {
                if (!keepLastLine)
                {
                    Console.CursorTop--;
                }
                Console.Write("Running configuration {0}", counter);
                var values = repBenchmark.MeasureConfiguration(config);
                Console.WriteLine();
                if (values == null || !repBenchmark.Metrics.All(m => values[m] != double.NaN))
                {
                    Console.WriteLine("The configuration [{0}] threw an exception and is therefore discarded.", config.Describe());
                    keepLastLine = true;
                }
                else
                {
                    measurements.Add(new MeasuredConfiguration <Configuration>(config, values));
                    keepLastLine = false;
                }
                counter++;
            }
            return(measurements);
        }
Beispiel #2
0
        private static IList <MeasuredConfiguration <Configuration> > PerformFullExploration(Configuration baseConfiguration, IBenchmark <Configuration> repBenchmark)
        {
            var counter      = 1;
            var measurements = new List <MeasuredConfiguration <Configuration> >();

            foreach (var config in baseConfiguration.GetAllPossibilities())
            {
                Console.Write("Running configuration {0}", counter);
                var values = repBenchmark.MeasureConfiguration(config);
                Console.WriteLine();
                if (values == null)
                {
                    Console.WriteLine("The configuration [{0}] threw an exception and is therefore discarded.", config.Describe());
                }
                else
                {
                    measurements.Add(new MeasuredConfiguration <Configuration>(config, values));
                }
                counter++;
            }
            return(measurements);
        }