Exemplo n.º 1
0
        private int CompareSubdirsByPostfixDispersion(string x, string y)
        {
            ComparisonStatistics a = cmp.Statistics.postfixes[x];
            ComparisonStatistics b = cmp.Statistics.postfixes[y];

            if (Math.Abs(a.DeltaSTD) > Math.Abs(b.DeltaSTD))
            {
                return(-1);
            }
            return(0);
        }
Exemplo n.º 2
0
        private int CompareSubdirsByPostfixMean(string x, string y)
        {
            ComparisonStatistics a = cmp.Statistics.postfixes[x];
            ComparisonStatistics b = cmp.Statistics.postfixes[y];

            if (a.DeltaMean < b.DeltaMean)
            {
                return(-1);
            }
            else if (a.DeltaMean > b.DeltaMean)
            {
                return(+1);
            }
            return(0);
        }
Exemplo n.º 3
0
        private int CompareSubdirsByPostfixDispersion(string x, string y)
        {
            ComparisonStatistics a = cmp.Statistics.postfixes[x];
            ComparisonStatistics b = cmp.Statistics.postfixes[y];
            double absA            = Math.Abs(a.DeltaSTD);
            double absB            = Math.Abs(b.DeltaSTD);

            if (absA > absB)
            {
                return(-1);
            }
            if (absA < absB)
            {
                return(1);
            }
            return(0);
        }
Exemplo n.º 4
0
        private int CompareSubdirsByDispersion(string x, string y)
        {
            ComparisonStatistics a = cmp.Statistics.subdirs[x];
            ComparisonStatistics b = cmp.Statistics.subdirs[y];
            double valA            = Math.Abs(a.DeltaSTD);
            double valB            = Math.Abs(b.DeltaSTD);

            if (valA > valB)
            {
                return(-1);
            }
            if (valA < valB)
            {
                return(1);
            }
            return(0);
        }
Exemplo n.º 5
0
        protected Panel buildDispersionHappinessPanelUsers(uint n)
        {
            ComparisonStatistics cs = cmp.Statistics;

            Panel p = new Panel();
            Table t = new Table();

            t.Enabled     = true;
            t.BorderWidth = 1;

            TableRow        row = new TableRow();
            TableHeaderCell thc = new TableHeaderCell();

            thc.Text = "User";
            row.Cells.Add(thc);
            thc      = new TableHeaderCell();
            thc.Text = "Dispersion";
            row.Cells.Add(thc);
            t.Rows.Add(row);

            List <string> sds = new List <string>();

            foreach (KeyValuePair <string, ComparisonStatistics> kvp in cmp.Statistics.postfixes)
            {
                sds.Add(kvp.Key);
            }
            sds.Sort(CompareSubdirsByPostfixDispersion);

            double vs = 15;

            uint count = 0;

            foreach (string s in sds)
            {
                t.Rows.Add(buildDispersionRow(s, cmp.Statistics.postfixes[s].DeltaSTD, vs, Color.Green, Color.Red));
                if (++count == n)
                {
                    break;
                }
            }

            p.Controls.Add(t);
            return(p);
        }
Exemplo n.º 6
0
        protected Panel buildMeanHappinessPanel()
        {
            ComparisonStatistics cs = cmp.Statistics;

            Panel p = new Panel();
            Table t = new Table();

            t.Enabled     = true;
            t.BorderWidth = 1;

            TableRow        row = new TableRow();
            TableHeaderCell thc = new TableHeaderCell();

            thc.Text = "Subdirectory";
            row.Cells.Add(thc);
            thc      = new TableHeaderCell();
            thc.Text = "Mean";
            row.Cells.Add(thc);
            t.Rows.Add(row);

            List <string> sds = new List <string>();

            foreach (KeyValuePair <string, ComparisonStatistics> kvp in cmp.Statistics.subdirs)
            {
                sds.Add(kvp.Key);
            }
            sds.Sort(CompareSubdirsByMean);

            foreach (string s in sds)
            {
                t.Rows.Add(buildMeanRow(s, cmp.Statistics.subdirs[s].DeltaMean, Color.Green, Color.Red));
            }

            p.Controls.Add(t);
            return(p);
        }
Exemplo n.º 7
0
        protected void ComputeStatistics()
        {
            _datapoints           = new List <Point>();
            _statistics           = new ComparisonStatistics();
            _statistics.postfixes = new Dictionary <string, ComparisonStatistics>();
            _statistics.subdirs   = new Dictionary <string, ComparisonStatistics>();

            if (_jX == null || _jY == null)
            {
                return;
            }
            if (_jX.Results.Length == 0 || _jY.Results.Length == 0)
            {
                return;
            }

            Array.Sort(_jX.Results, csvrow_lt);
            Array.Sort(_jY.Results, csvrow_lt);

            int yi = 0;
            var yr = _jY.Results[yi];

            if (yr.Filename.StartsWith(_prefix))
            {
                AddStatisticsY(yr);
            }
            string last_x = null, last_y = null;

            foreach (var xr in _jX.Results)
            {
                if (!xr.Filename.StartsWith(_prefix) ||
                    (last_x != null && last_x.CompareTo(xr.Filename) == 0)) // ignore duplicates.
                {
                    continue;
                }

                while (yr != null)
                {
                    if (yr.Filename.CompareTo(xr.Filename) >= 0)
                    {
                        break;
                    }
                    last_y = yr.Filename;
                    while (_jY.Results[yi].Filename == last_y) // ignore duplicates.
                    {
                        if (++yi >= _jY.Results.Length)
                        {
                            yr = null; break;
                        }
                        else
                        {
                            yr = _jY.Results[yi];
                        }
                    }
                    if (yr != null && yr.Filename.StartsWith(_prefix))
                    {
                        AddStatisticsY(yr);
                    }
                }

                if (yr == null)
                {
                    continue;
                }

                AddStatisticsX(xr);

                if (yr.Filename.CompareTo(xr.Filename) == 0)
                {
                    AddStatisticsXY(xr, yr);
                    AddDataPoint(xr, yr);
                }

                last_x = xr.Filename;
            }

            for (yi++; yi < _jY.Results.Length; yi++)
            {
                yr = _jY.Results[yi];
                if (!yr.Filename.StartsWith(_prefix) ||
                    (last_y != null && last_y.CompareTo(yr.Filename) == 0)) // ignore duplicates.
                {
                    continue;
                }
                Debug.Assert(yr.Filename.StartsWith(_prefix));
                AddStatisticsY(yr);
                last_y = yr.Filename;
            }
        }
Exemplo n.º 8
0
        protected Panel buildSummary()
        {
            ComparisonStatistics cs = cmp.Statistics;

            Panel p = new Panel();
            Table t = new Table();

            t.BorderWidth = 1;

            TableRow        row = new TableRow();
            TableHeaderCell thc = new TableHeaderCell();

            thc.Text            = "";
            thc.HorizontalAlign = HorizontalAlign.Left;
            row.Cells.Add(thc);
            thc = new TableHeaderCell();
            thc.HorizontalAlign = HorizontalAlign.Center;
            thc.Text            = cmp.ShortNameX;
            row.Cells.Add(thc);
            thc = new TableHeaderCell();
            thc.HorizontalAlign = HorizontalAlign.Center;
            thc.Text            = cmp.ShortNameY;
            row.Cells.Add(thc);
            thc = new TableHeaderCell();
            thc.HorizontalAlign = HorizontalAlign.Center;
            thc.Text            = "Relative";
            row.Cells.Add(thc);
            t.Rows.Add(row);

            row = new TableRow();
            TableCell tc = new TableCell();

            row.Cells.Add(tc);
            tc.Text = "Date";
            tc      = new TableCell();
            tc.Text = cmp.DateX;
            row.Cells.Add(tc);
            tc      = new TableCell();
            tc.Text = cmp.DateY;
            row.Cells.Add(tc);
            tc = new TableCell();
            if (cmp.JobY != null && cmp.JobX != null)
            {
                tc.Text = (cmp.JobY.MetaData.SubmissionTime - cmp.JobX.MetaData.SubmissionTime).ToString();
            }
            row.Cells.Add(tc);
            t.Rows.Add(row);

            t.Rows.Add(buildStatisticsRow("Files:", cs.x_files, cs.y_files, "", 100.0 * ((cs.y_files / cs.x_files) - 1.0), "%", Color.Green, Color.Red));
            t.Rows.Add(buildStatisticsRow("Results:", cs.CountX, cs.CountY, "", 100.0 * ((cs.CountY / cs.CountX) - 1.0), "%", Color.Green, Color.Red));
            t.Rows.Add(buildStatisticsRow("Results (SAT):", cs.x_countSAT, cs.y_countSAT, "", 100.0 * ((cs.y_countSAT / cs.x_countSAT) - 1.0), "%", Color.Green, Color.Red));
            t.Rows.Add(buildStatisticsRow("Results (UNSAT):", cs.x_countUNSAT, cs.y_countUNSAT, "", 100.0 * ((cs.y_countUNSAT / cs.x_countUNSAT) - 1.0), "%", Color.Green, Color.Red));
            t.Rows.Add(buildStatisticsRow("Results (UNKNOWN):", cs.x_countUNKNOWN, cs.y_countUNKNOWN, "", 100.0 * ((cs.y_countUNKNOWN / cs.x_countUNKNOWN) - 1.0), "%", Color.Red, Color.Green));
            t.Rows.Add(buildStatisticsRow("Avg. Time/Result:", cs.TimeX / cs.CountX, cs.TimeY / cs.CountY, "sec.", 100.0 * (((cs.TimeY / cs.CountY) / (cs.TimeX / cs.CountX)) - 1.0), "%", Color.Red, Color.Green));
            t.Rows.Add(buildStatisticsRow("Avg. Time/Result (SAT):", cs.x_cumulativeTimeSAT / cs.x_countSAT, cs.y_cumulativeTimeSAT / cs.y_countSAT, "sec.", 100.0 * (((cs.y_cumulativeTimeSAT / cs.y_countSAT) / (cs.x_cumulativeTimeSAT / cs.x_countSAT)) - 1.0), "%", Color.Red, Color.Green));
            t.Rows.Add(buildStatisticsRow("Avg. Time/Result (UNSAT):", cs.x_cumulativeTimeUNSAT / cs.x_countUNSAT, cs.y_cumulativeTimeUNSAT / cs.y_countUNSAT, "sec.", 100.0 * (((cs.y_cumulativeTimeUNSAT / cs.y_countUNSAT) / (cs.x_cumulativeTimeUNSAT / cs.x_countUNSAT)) - 1.0), "%", Color.Red, Color.Green));
            t.Rows.Add(buildStatisticsRow("Avg. Time/Result (UNKNOWN):", cs.x_cumulativeTimeUNKNOWN / cs.x_countUNKNOWN, cs.y_cumulativeTimeUNKNOWN / cs.y_countUNKNOWN, "sec.", 100.0 * (((cs.y_cumulativeTimeUNKNOWN / cs.y_countUNKNOWN) / (cs.x_cumulativeTimeUNKNOWN / cs.x_countUNKNOWN)) - 1.0), "%", Color.Red, Color.Green));


            Table t2 = new Table();

            row                 = new TableRow();
            thc                 = new TableHeaderCell();
            thc.Text            = "Statistic";
            thc.HorizontalAlign = HorizontalAlign.Left;
            row.Cells.Add(thc);
            thc                 = new TableHeaderCell();
            thc.Text            = "Value";
            thc.HorizontalAlign = HorizontalAlign.Left;
            row.Cells.Add(thc);
            t2.Rows.Add(row);

            row                = new TableRow();
            tc                 = new TableCell();
            tc.Text            = "Mean Delta";
            tc.HorizontalAlign = HorizontalAlign.Left;
            row.Cells.Add(tc);
            tc = new TableCell();
            tc.HorizontalAlign = HorizontalAlign.Right;
            tc.Text            = cmp.Statistics.DeltaMean.ToString("F3");
            row.Cells.Add(tc);
            t2.Rows.Add(row);

            row                = new TableRow();
            tc                 = new TableCell();
            tc.Text            = "Dispersion Delta (Std. Dev.)";
            tc.HorizontalAlign = HorizontalAlign.Left;
            row.Cells.Add(tc);
            tc = new TableCell();
            tc.HorizontalAlign = HorizontalAlign.Right;
            tc.Text            = cmp.Statistics.DeltaSTD.ToString("F3");
            row.Cells.Add(tc);
            t2.Rows.Add(row);

            row                = new TableRow();
            tc                 = new TableCell();
            tc.Text            = "Median Delta (P50)";
            tc.HorizontalAlign = HorizontalAlign.Left;
            row.Cells.Add(tc);
            tc = new TableCell();
            tc.HorizontalAlign = HorizontalAlign.Right;
            tc.Text            = cmp.Statistics.DeltaP50.ToString("F3");
            row.Cells.Add(tc);
            t2.Rows.Add(row);

            row                = new TableRow();
            tc                 = new TableCell();
            tc.Text            = "[P1;P99]";
            tc.HorizontalAlign = HorizontalAlign.Left;
            row.Cells.Add(tc);
            tc = new TableCell();
            tc.HorizontalAlign = HorizontalAlign.Right;
            tc.Text            = "[" + cmp.Statistics.DeltaP1.ToString("F2") + ";" + cmp.Statistics.DeltaP99.ToString("F2") + "]";
            row.Cells.Add(tc);
            t2.Rows.Add(row);

            Table     bigtable = new Table();
            TableRow  bigrow   = new TableRow();
            TableCell bigcell  = new TableCell();

            bigcell.HorizontalAlign = HorizontalAlign.Center;
            bigcell.Controls.Add(t);
            bigrow.Cells.Add(bigcell);
            bigcell = new TableCell();
            bigcell.HorizontalAlign = HorizontalAlign.Center;
            bigcell.Controls.Add(t2);
            bigrow.Cells.Add(bigcell);
            bigtable.Rows.Add(bigrow);
            p.Controls.Add(bigtable);
            return(p);
        }