Changeset 14652


Ignore:
Timestamp:
02/07/17 17:15:50 (18 months ago)
Author:
abeham
Message:

#2634:

  • changed relative/absolute checkbox button into combobox
  • added optional markers
  • added translucency of line in case run-data is more scarce (e.g. because they're already terminated)
Location:
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionRLDView.Designer.cs

    r14647 r14652  
    6464      this.tabControl = new System.Windows.Forms.TabControl();
    6565      this.byTargetTabPage = new System.Windows.Forms.TabPage();
     66      this.relativeOrAbsoluteComboBox = new System.Windows.Forms.ComboBox();
    6667      this.targetChart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
     68      this.markerCheckBox = new System.Windows.Forms.CheckBox();
    6769      this.boundShadingCheckBox = new System.Windows.Forms.CheckBox();
    68       this.targetsRelativeCheckBox = new System.Windows.Forms.CheckBox();
    6970      this.byCostTabPage = new System.Windows.Forms.TabPage();
    7071      this.byCostViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    7172      this.budgetLogScalingCheckBox = new System.Windows.Forms.CheckBox();
    72       this.eachOrAllBudgetsCheckBox = new System.Windows.Forms.CheckBox();
     73      this.aggregateBudgetsCheckBox = new System.Windows.Forms.CheckBox();
    7374      this.generateBudgetsButton = new System.Windows.Forms.Button();
    7475      this.byTableTabPage = new System.Windows.Forms.TabPage();
     
    144145      this.targetsTextBox.Location = new System.Drawing.Point(59, 8);
    145146      this.targetsTextBox.Name = "targetsTextBox";
    146       this.targetsTextBox.Size = new System.Drawing.Size(211, 20);
     147      this.targetsTextBox.Size = new System.Drawing.Size(204, 20);
    147148      this.targetsTextBox.TabIndex = 1;
    148149      this.toolTip.SetToolTip(this.targetsTextBox, "The order of the targets is important, first to-hit targets\r\nshould be given firs" +
     
    201202      this.budgetsTextBox.Location = new System.Drawing.Point(59, 8);
    202203      this.budgetsTextBox.Name = "budgetsTextBox";
    203       this.budgetsTextBox.Size = new System.Drawing.Size(326, 20);
     204      this.budgetsTextBox.Size = new System.Drawing.Size(309, 20);
    204205      this.budgetsTextBox.TabIndex = 6;
    205206      this.budgetsTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.budgetsTextBox_Validating);
     
    222223      this.aggregateTargetsCheckBox.Checked = true;
    223224      this.aggregateTargetsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
    224       this.aggregateTargetsCheckBox.Location = new System.Drawing.Point(353, 10);
     225      this.aggregateTargetsCheckBox.Location = new System.Drawing.Point(374, 10);
    225226      this.aggregateTargetsCheckBox.Name = "aggregateTargetsCheckBox";
    226227      this.aggregateTargetsCheckBox.Size = new System.Drawing.Size(74, 17);
     
    246247      // byTargetTabPage
    247248      //
     249      this.byTargetTabPage.Controls.Add(this.relativeOrAbsoluteComboBox);
    248250      this.byTargetTabPage.Controls.Add(this.targetChart);
     251      this.byTargetTabPage.Controls.Add(this.markerCheckBox);
    249252      this.byTargetTabPage.Controls.Add(this.boundShadingCheckBox);
    250253      this.byTargetTabPage.Controls.Add(this.targetLogScalingCheckBox);
    251254      this.byTargetTabPage.Controls.Add(this.targetsLabel);
    252       this.byTargetTabPage.Controls.Add(this.targetsRelativeCheckBox);
    253255      this.byTargetTabPage.Controls.Add(this.aggregateTargetsCheckBox);
    254256      this.byTargetTabPage.Controls.Add(this.targetsTextBox);
     
    262264      this.byTargetTabPage.Text = "Performance by Target";
    263265      this.byTargetTabPage.UseVisualStyleBackColor = true;
     266      //
     267      // relativeOrAbsoluteComboBox
     268      //
     269      this.relativeOrAbsoluteComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     270      this.relativeOrAbsoluteComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     271      this.relativeOrAbsoluteComboBox.FormattingEnabled = true;
     272      this.relativeOrAbsoluteComboBox.Items.AddRange(new object[] {
     273            "relative",
     274            "absolute"});
     275      this.relativeOrAbsoluteComboBox.Location = new System.Drawing.Point(269, 8);
     276      this.relativeOrAbsoluteComboBox.Name = "relativeOrAbsoluteComboBox";
     277      this.relativeOrAbsoluteComboBox.Size = new System.Drawing.Size(99, 21);
     278      this.relativeOrAbsoluteComboBox.TabIndex = 8;
     279      this.relativeOrAbsoluteComboBox.SelectedIndexChanged += new System.EventHandler(this.relativeOrAbsoluteComboBox_SelectedIndexChanged);
    264280      //
    265281      // targetChart
     
    293309      this.targetChart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove);
    294310      //
     311      // markerCheckBox
     312      //
     313      this.markerCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     314      this.markerCheckBox.AutoSize = true;
     315      this.markerCheckBox.Location = new System.Drawing.Point(229, 364);
     316      this.markerCheckBox.Name = "markerCheckBox";
     317      this.markerCheckBox.Size = new System.Drawing.Size(91, 17);
     318      this.markerCheckBox.TabIndex = 6;
     319      this.markerCheckBox.Text = "show markers";
     320      this.markerCheckBox.UseVisualStyleBackColor = true;
     321      this.markerCheckBox.CheckedChanged += new System.EventHandler(this.markerCheckBox_CheckedChanged);
     322      //
    295323      // boundShadingCheckBox
    296324      //
     
    307335      this.boundShadingCheckBox.CheckedChanged += new System.EventHandler(this.boundShadingCheckBox_CheckedChanged);
    308336      //
    309       // targetsRelativeCheckBox
    310       //
    311       this.targetsRelativeCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    312       this.targetsRelativeCheckBox.Appearance = System.Windows.Forms.Appearance.Button;
    313       this.targetsRelativeCheckBox.Checked = true;
    314       this.targetsRelativeCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
    315       this.targetsRelativeCheckBox.Location = new System.Drawing.Point(276, 6);
    316       this.targetsRelativeCheckBox.Name = "targetsRelativeCheckBox";
    317       this.targetsRelativeCheckBox.Size = new System.Drawing.Size(65, 23);
    318       this.targetsRelativeCheckBox.TabIndex = 2;
    319       this.targetsRelativeCheckBox.Text = "relative";
    320       this.targetsRelativeCheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
    321       this.targetsRelativeCheckBox.UseVisualStyleBackColor = true;
    322       this.targetsRelativeCheckBox.CheckedChanged += new System.EventHandler(this.targetsRelativeCheckBox_CheckedChanged);
    323       //
    324337      // byCostTabPage
    325338      //
    326339      this.byCostTabPage.Controls.Add(this.byCostViewHost);
    327340      this.byCostTabPage.Controls.Add(this.budgetLogScalingCheckBox);
    328       this.byCostTabPage.Controls.Add(this.eachOrAllBudgetsCheckBox);
     341      this.byCostTabPage.Controls.Add(this.aggregateBudgetsCheckBox);
    329342      this.byCostTabPage.Controls.Add(this.generateBudgetsButton);
    330343      this.byCostTabPage.Controls.Add(this.budgetsLabel);
     
    367380      this.budgetLogScalingCheckBox.CheckedChanged += new System.EventHandler(this.logScalingCheckBox_CheckedChanged);
    368381      //
    369       // eachOrAllBudgetsCheckBox
    370       //
    371       this.eachOrAllBudgetsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    372       this.eachOrAllBudgetsCheckBox.AutoSize = true;
    373       this.eachOrAllBudgetsCheckBox.Location = new System.Drawing.Point(414, 10);
    374       this.eachOrAllBudgetsCheckBox.Name = "eachOrAllBudgetsCheckBox";
    375       this.eachOrAllBudgetsCheckBox.Size = new System.Drawing.Size(36, 17);
    376       this.eachOrAllBudgetsCheckBox.TabIndex = 10;
    377       this.eachOrAllBudgetsCheckBox.Text = "all";
    378       this.eachOrAllBudgetsCheckBox.UseVisualStyleBackColor = true;
    379       this.eachOrAllBudgetsCheckBox.CheckedChanged += new System.EventHandler(this.eachOrAllBudgetsCheckBox_CheckedChanged);
     382      // aggregateBudgetsCheckBox
     383      //
     384      this.aggregateBudgetsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     385      this.aggregateBudgetsCheckBox.AutoSize = true;
     386      this.aggregateBudgetsCheckBox.Checked = true;
     387      this.aggregateBudgetsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
     388      this.aggregateBudgetsCheckBox.Location = new System.Drawing.Point(374, 10);
     389      this.aggregateBudgetsCheckBox.Name = "aggregateBudgetsCheckBox";
     390      this.aggregateBudgetsCheckBox.Size = new System.Drawing.Size(74, 17);
     391      this.aggregateBudgetsCheckBox.TabIndex = 10;
     392      this.aggregateBudgetsCheckBox.Text = "aggregate";
     393      this.aggregateBudgetsCheckBox.UseVisualStyleBackColor = true;
     394      this.aggregateBudgetsCheckBox.CheckedChanged += new System.EventHandler(this.aggregateBudgetsCheckBox_CheckedChanged);
    380395      //
    381396      // generateBudgetsButton
     
    481496    private System.Windows.Forms.TabPage byCostTabPage;
    482497    private System.Windows.Forms.TabPage byTableTabPage;
    483     private System.Windows.Forms.CheckBox eachOrAllBudgetsCheckBox;
     498    private System.Windows.Forms.CheckBox aggregateBudgetsCheckBox;
    484499    private System.Windows.Forms.Button generateBudgetsButton;
    485500    private System.Windows.Forms.CheckBox budgetLogScalingCheckBox;
     
    490505    private MainForm.WindowsForms.ViewHost byCostViewHost;
    491506    private System.Windows.Forms.CheckBox boundShadingCheckBox;
    492     private System.Windows.Forms.CheckBox targetsRelativeCheckBox;
     507    private System.Windows.Forms.CheckBox markerCheckBox;
     508    private System.Windows.Forms.ComboBox relativeOrAbsoluteComboBox;
    493509  }
    494510}
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionRLDView.cs

    r14647 r14652  
    106106      };
    107107      byCostViewHost.Content = byCostDataTable;
    108       targetsRelativeCheckBox.Checked = targetsAreRelative;
     108      suppressUpdates = true;
     109      relativeOrAbsoluteComboBox.SelectedItem = targetsAreRelative ? "relative" : "absolute";
    109110      problems = new BindingList<ProblemInstance>();
    110111      problemComboBox.DataSource = new BindingSource() { DataSource = problems };
     
    399400          }
    400401        }
     402        var showMarkers = markerCheckBox.Checked;
    401403        foreach (var list in hits) {
    402404          var row = new Series(list.Key) {
    403405            ChartType = SeriesChartType.StepLine,
    404             BorderWidth = 2,
     406            BorderWidth = 3,
    405407            Color = colors[colorCount],
    406408            BorderDashStyle = lineStyles[lineStyleCount],
     
    420422          if (aggregateTargetsCheckBox.Checked) totalTargets *= targets.Length;
    421423          var movingTargets = totalTargets;
     424          var labelPrinted = false;
    422425          foreach (var h in list.Value) {
     426            var prevmissedecdf = missedecdf;
    423427            while (moreMisses && iter.Current.Key <= h.Key) {
     428              if (!labelPrinted && row.Points.Count > 0) {
     429                var point = row.Points.Last();
     430                point.Label = row.Name;
     431                point.MarkerStyle = MarkerStyle.Cross;
     432                point.MarkerBorderWidth = 1;
     433                point.MarkerSize = 10;
     434                labelPrinted = true;
     435                rowShade.Points.Add(new DataPoint(point.XValue, new[] { ecdf / totalTargets, (ecdf + missedecdf) / totalTargets }));
     436              }
    424437              missedecdf += iter.Current.Value;
    425438              movingTargets -= iter.Current.Value;
    426               if (row.Points.Count > 0 && row.Points.Last().XValue == iter.Current.Key)
     439              if (row.Points.Count > 0 && row.Points.Last().XValue == iter.Current.Key) {
    427440                row.Points.Last().SetValueY(ecdf / movingTargets);
    428               else row.Points.AddXY(iter.Current.Key, ecdf / movingTargets);
     441                row.Points.Last().Color = Color.FromArgb(255 - (int)Math.Floor(255 * (prevmissedecdf / totalTargets)), colors[colorCount]);
     442              } else {
     443                var dp = new DataPoint(iter.Current.Key, ecdf / movingTargets) {
     444                  Color = Color.FromArgb(255 - (int)Math.Floor(255 * (prevmissedecdf / totalTargets)), colors[colorCount])
     445                };
     446                if (showMarkers) {
     447                  dp.MarkerStyle = MarkerStyle.Circle;
     448                  dp.MarkerBorderWidth = 1;
     449                  dp.MarkerSize = 5;
     450                }
     451                row.Points.Add(dp);
     452                prevmissedecdf = missedecdf;
     453              }
    429454              if (boundShadingCheckBox.Checked) {
    430455                if (rowShade.Points.Count > 0 && rowShade.Points.Last().XValue == iter.Current.Key)
     
    433458              }
    434459              moreMisses = iter.MoveNext();
     460              if (!labelPrinted) {
     461                var point = row.Points.Last();
     462                point.Label = row.Name;
     463                point.MarkerStyle = MarkerStyle.Cross;
     464                point.MarkerBorderWidth = 1;
     465                point.MarkerSize = 10;
     466                labelPrinted = true;
     467              }
    435468            }
    436469            ecdf += h.Value;
    437             if (row.Points.Count > 0 && row.Points.Last().XValue == h.Key)
     470            if (row.Points.Count > 0 && row.Points.Last().XValue == h.Key) {
    438471              row.Points.Last().SetValueY(ecdf / movingTargets);
    439             else row.Points.AddXY(h.Key, ecdf / movingTargets);
     472              row.Points.Last().Color = Color.FromArgb(255 - (int)Math.Floor(255 * (missedecdf / totalTargets)), colors[colorCount]);
     473            } else {
     474              var dp = new DataPoint(h.Key, ecdf / movingTargets) {
     475                Color = Color.FromArgb(255 - (int)Math.Floor(255 * (missedecdf / totalTargets)), colors[colorCount])
     476              };
     477              if (showMarkers) {
     478                dp.MarkerStyle = MarkerStyle.Circle;
     479                dp.MarkerBorderWidth = 1;
     480                dp.MarkerSize = 5;
     481              }
     482              row.Points.Add(dp);
     483            }
    440484            if (missedecdf > 0 && boundShadingCheckBox.Checked) {
    441485              if (rowShade.Points.Count > 0 && rowShade.Points.Last().XValue == h.Key)
     
    445489          }
    446490
     491          if (!labelPrinted && row.Points.Count > 0) {
     492            var point = row.Points.Last();
     493            point.Label = row.Name;
     494            point.MarkerStyle = MarkerStyle.Cross;
     495            point.MarkerBorderWidth = 1;
     496            point.MarkerSize = 10;
     497            rowShade.Points.Add(new DataPoint(point.XValue, new[] { ecdf / totalTargets, (ecdf + missedecdf) / totalTargets }));
     498          }
     499
    447500          while (moreMisses) {
    448501            // if there are misses beyond the last hit we extend the shaded area
    449502            missedecdf += iter.Current.Value;
    450503            //movingTargets -= iter.Current.Value;
    451             if (row.Points.Count > 0 && row.Points.Last().XValue == iter.Current.Key)
     504            if (row.Points.Count > 0 && row.Points.Last().XValue == iter.Current.Key) {
    452505              row.Points.Last().SetValueY(ecdf / movingTargets);
    453             else row.Points.AddXY(iter.Current.Key, ecdf / movingTargets);
     506              row.Points.Last().Color = Color.FromArgb(255 - (int)Math.Floor(255 * (missedecdf / totalTargets)), colors[colorCount]);
     507            } else {
     508              var dp = new DataPoint(iter.Current.Key, ecdf / movingTargets) {
     509                Color = Color.FromArgb(255 - (int)Math.Floor(255 * (missedecdf / totalTargets)), colors[colorCount])
     510              };
     511              if (showMarkers) {
     512                dp.MarkerStyle = MarkerStyle.Circle;
     513                dp.MarkerBorderWidth = 1;
     514                dp.MarkerSize = 5;
     515              }
     516              row.Points.Add(dp);
     517            }
    454518            if (boundShadingCheckBox.Checked) {
    455519              if (rowShade.Points.Count > 0 && rowShade.Points.Last().XValue == iter.Current.Key)
     
    460524          }
    461525
    462           if (maxLength > 0 && (row.Points.Count == 0 || row.Points.Last().XValue < maxLength))
    463             row.Points.AddXY(maxLength, ecdf / movingTargets);
    464 
    465           if (row.Points.Count > 0) {
    466             var point = row.Points.Last();
    467             point.Label = row.Name;
    468             point.MarkerStyle = MarkerStyle.Cross;
    469             point.MarkerBorderWidth = 1;
     526          if (maxLength > 0 && (row.Points.Count == 0 || row.Points.Last().XValue < maxLength)) {
     527            var dp = new DataPoint(maxLength, ecdf / movingTargets) {
     528              Color = Color.FromArgb(255 - (int)Math.Floor(255 * (missedecdf / totalTargets)), colors[colorCount])
     529            };
     530            if (showMarkers) {
     531              dp.MarkerStyle = MarkerStyle.Circle;
     532              dp.MarkerBorderWidth = 1;
     533              dp.MarkerSize = 5;
     534            }
     535            row.Points.Add(dp);
    470536          }
    471537
     
    651717            var resultsTable = (IndexedDataTable<double>)run.Results[table];
    652718
    653             if (eachOrAllBudgetsCheckBox.Checked) {
     719            if (aggregateBudgetsCheckBox.Checked) {
     720              CalculateHitsForAllBudgets(hits, resultsTable.Rows.First(), group.Value.Count, problem.Key, group.Key, problem.Value.Count);
     721            } else {
    654722              CalculateHitsForEachBudget(hits, resultsTable.Rows.First(), group.Value.Count, problem.Key, group.Key, problem.Value.Count);
    655             } else {
    656               CalculateHitsForAllBudgets(hits, resultsTable.Rows.First(), group.Value.Count, problem.Key, group.Key, problem.Value.Count);
    657723            }
    658724          }
     
    835901    }
    836902
    837     private void targetsRelativeCheckBox_CheckedChanged(object sender, EventArgs e) {
    838       targetsRelativeCheckBox.Text = targetsRelativeCheckBox.Checked ? "relative" : "absolute";
     903    private void relativeOrAbsoluteComboBox_SelectedIndexChanged(object sender, EventArgs e) {
    839904      if (suppressUpdates) return;
    840905      var pd = (ProblemInstance)problemComboBox.SelectedItem;
     
    851916        }
    852917      }
    853       targetsAreRelative = targetsRelativeCheckBox.Checked;
     918      targetsAreRelative = (string)relativeOrAbsoluteComboBox.SelectedItem == "relative";
    854919      SuspendRepaint();
    855920      suppressTargetsEvents = true;
     
    919984      }
    920985    }
     986
     987    private void markerCheckBox_CheckedChanged(object sender, EventArgs e) {
     988      SuspendRepaint();
     989      try {
     990        UpdateResultsByTarget();
     991      } finally { ResumeRepaint(true); }
     992    }
    921993    #endregion
    922994
     
    9481020    }
    9491021
    950     private void eachOrAllBudgetsCheckBox_CheckedChanged(object sender, EventArgs e) {
    951       var each = eachOrAllBudgetsCheckBox.Checked;
    952       eachOrAllBudgetsCheckBox.Text = each ? "each" : "all";
     1022    private void aggregateBudgetsCheckBox_CheckedChanged(object sender, EventArgs e) {
    9531023      SuspendRepaint();
    9541024      try {
Note: See TracChangeset for help on using the changeset viewer.