Exemple #1
0
        public void GetManualTable()
        {
            //var folder = @"1594656126_Manual";
            var folder    = $"1594705922_manual";
            var resultOld = LoadResult(folder, "Old");
            var resultNew = LoadResult(folder, "New");

            var differences = BoxPlotHelper.GetTimeDifferences(resultNew, resultOld);

            for (int i = 0; i < differences.Count; i++)
            {
                var oldResult = resultOld.BenchmarkResults[i];
                var newResult = resultNew.BenchmarkResults[i];
                var name      = oldResult.InputName;
                name = name.Replace("_", " ");

                if (name.Contains("wc"))
                {
                    continue;
                }

                var diffText = $"{(differences[i] > 0 ? "+" : "")}{differences[i]:##.}\\%";

                if (differences[i] >= 5)
                {
                    diffText = @"\textcolor{red}{" + diffText + @"}";
                }
                if (differences[i] <= -5)
                {
                    diffText = @"\textcolor{ForestGreen}{" + diffText + @"}";
                }

                Console.WriteLine($"{name} & {oldResult.Runs.Average(x=>x.Time) / 1000d:0.00}s & {newResult.Runs.Average(x=>x.Time) / 1000d:0.00}s & {diffText} \\\\");
            }
        }
Exemple #2
0
        public void RunBoxPlot()
        {
            // var folder = @"1586506670_OneImprovementDisabled";
            // var folder = @"1590239906_OneImprovementEnabled";
            // var folder = @"1590241123_OneImprovementDisabled";
            var folder          = @"1594643749_Manual";
            var excludeOutliers = false;

            //var resultOld = LoadResult(folder, "Old");
            //var resultNew = LoadResult(folder, "ChainDecomposition");

            //var resultOld = LoadResult(folder, "Old");
            //var resultNew = LoadResult(folder, "New");
            //var resultWithoutChainDecomposition = LoadResult(folder, "WithoutChainDecomposition");
            //var resultWithoutGreedyTrees = LoadResult(folder, "WithoutGreedyTrees");
            //var resultWithoutMaxIterations = LoadResult(folder, "WithoutMaxIterations");

            var resultOld = LoadResult(folder, "Old");
            var resultNew = LoadResult(folder, "New");
            var resultWithoutChainDecomposition = LoadResult(folder, "ChainDecomposition");
            var resultWithoutGreedyTrees        = LoadResult(folder, "GreedyTrees");
            var resultWithoutMaxIterations      = LoadResult(folder, "MaxIterations");

            //OutputPlot(BoxPlotHelper.GetBoxPlotValues(resultWithoutChainDecomposition, resultOld, excludeOutliers));
            //OutputPlot(BoxPlotHelper.GetBoxPlotValues(resultWithoutGreedyTrees, resultOld, excludeOutliers));
            //OutputPlot(BoxPlotHelper.GetBoxPlotValues(resultWithoutMaxIterations, resultOld, excludeOutliers));
            //OutputPlot(BoxPlotHelper.GetBoxPlotValues(resultNew, resultOld, excludeOutliers));

            var differences = BoxPlotHelper.GetTimeDifferences(resultNew, resultOld);

            for (int i = 0; i < differences.Count; i++)
            {
                Console.WriteLine($"{i} & {differences[i]} \\\\");
            }

            Console.WriteLine();

            differences.Sort();
            differences.Reverse();
            for (int i = 0; i < differences.Count; i++)
            {
                Console.WriteLine($"{i} & {differences[i]} \\\\");
            }

            Console.WriteLine();

            for (int i = 0; i < differences.Count; i++)
            {
                if (i % 2 == 0)
                {
                    Console.WriteLine($"{i} & {differences[i]} \\\\");
                }
            }

            Console.WriteLine();

            for (int i = 0; i < differences.Count; i++)
            {
                if (i % 2 == 1)
                {
                    Console.WriteLine($"{i} & {differences[i]} \\\\");
                }
            }

            Console.WriteLine();
        }