Changeset 14652
- Timestamp:
- 02/07/17 17:15:50 (8 years ago)
- 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 64 64 this.tabControl = new System.Windows.Forms.TabControl(); 65 65 this.byTargetTabPage = new System.Windows.Forms.TabPage(); 66 this.relativeOrAbsoluteComboBox = new System.Windows.Forms.ComboBox(); 66 67 this.targetChart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart(); 68 this.markerCheckBox = new System.Windows.Forms.CheckBox(); 67 69 this.boundShadingCheckBox = new System.Windows.Forms.CheckBox(); 68 this.targetsRelativeCheckBox = new System.Windows.Forms.CheckBox();69 70 this.byCostTabPage = new System.Windows.Forms.TabPage(); 70 71 this.byCostViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 71 72 this.budgetLogScalingCheckBox = new System.Windows.Forms.CheckBox(); 72 this. eachOrAllBudgetsCheckBox = new System.Windows.Forms.CheckBox();73 this.aggregateBudgetsCheckBox = new System.Windows.Forms.CheckBox(); 73 74 this.generateBudgetsButton = new System.Windows.Forms.Button(); 74 75 this.byTableTabPage = new System.Windows.Forms.TabPage(); … … 144 145 this.targetsTextBox.Location = new System.Drawing.Point(59, 8); 145 146 this.targetsTextBox.Name = "targetsTextBox"; 146 this.targetsTextBox.Size = new System.Drawing.Size(2 11, 20);147 this.targetsTextBox.Size = new System.Drawing.Size(204, 20); 147 148 this.targetsTextBox.TabIndex = 1; 148 149 this.toolTip.SetToolTip(this.targetsTextBox, "The order of the targets is important, first to-hit targets\r\nshould be given firs" + … … 201 202 this.budgetsTextBox.Location = new System.Drawing.Point(59, 8); 202 203 this.budgetsTextBox.Name = "budgetsTextBox"; 203 this.budgetsTextBox.Size = new System.Drawing.Size(3 26, 20);204 this.budgetsTextBox.Size = new System.Drawing.Size(309, 20); 204 205 this.budgetsTextBox.TabIndex = 6; 205 206 this.budgetsTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.budgetsTextBox_Validating); … … 222 223 this.aggregateTargetsCheckBox.Checked = true; 223 224 this.aggregateTargetsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 224 this.aggregateTargetsCheckBox.Location = new System.Drawing.Point(3 53, 10);225 this.aggregateTargetsCheckBox.Location = new System.Drawing.Point(374, 10); 225 226 this.aggregateTargetsCheckBox.Name = "aggregateTargetsCheckBox"; 226 227 this.aggregateTargetsCheckBox.Size = new System.Drawing.Size(74, 17); … … 246 247 // byTargetTabPage 247 248 // 249 this.byTargetTabPage.Controls.Add(this.relativeOrAbsoluteComboBox); 248 250 this.byTargetTabPage.Controls.Add(this.targetChart); 251 this.byTargetTabPage.Controls.Add(this.markerCheckBox); 249 252 this.byTargetTabPage.Controls.Add(this.boundShadingCheckBox); 250 253 this.byTargetTabPage.Controls.Add(this.targetLogScalingCheckBox); 251 254 this.byTargetTabPage.Controls.Add(this.targetsLabel); 252 this.byTargetTabPage.Controls.Add(this.targetsRelativeCheckBox);253 255 this.byTargetTabPage.Controls.Add(this.aggregateTargetsCheckBox); 254 256 this.byTargetTabPage.Controls.Add(this.targetsTextBox); … … 262 264 this.byTargetTabPage.Text = "Performance by Target"; 263 265 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); 264 280 // 265 281 // targetChart … … 293 309 this.targetChart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove); 294 310 // 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 // 295 323 // boundShadingCheckBox 296 324 // … … 307 335 this.boundShadingCheckBox.CheckedChanged += new System.EventHandler(this.boundShadingCheckBox_CheckedChanged); 308 336 // 309 // targetsRelativeCheckBox310 //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 //324 337 // byCostTabPage 325 338 // 326 339 this.byCostTabPage.Controls.Add(this.byCostViewHost); 327 340 this.byCostTabPage.Controls.Add(this.budgetLogScalingCheckBox); 328 this.byCostTabPage.Controls.Add(this. eachOrAllBudgetsCheckBox);341 this.byCostTabPage.Controls.Add(this.aggregateBudgetsCheckBox); 329 342 this.byCostTabPage.Controls.Add(this.generateBudgetsButton); 330 343 this.byCostTabPage.Controls.Add(this.budgetsLabel); … … 367 380 this.budgetLogScalingCheckBox.CheckedChanged += new System.EventHandler(this.logScalingCheckBox_CheckedChanged); 368 381 // 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); 380 395 // 381 396 // generateBudgetsButton … … 481 496 private System.Windows.Forms.TabPage byCostTabPage; 482 497 private System.Windows.Forms.TabPage byTableTabPage; 483 private System.Windows.Forms.CheckBox eachOrAllBudgetsCheckBox;498 private System.Windows.Forms.CheckBox aggregateBudgetsCheckBox; 484 499 private System.Windows.Forms.Button generateBudgetsButton; 485 500 private System.Windows.Forms.CheckBox budgetLogScalingCheckBox; … … 490 505 private MainForm.WindowsForms.ViewHost byCostViewHost; 491 506 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; 493 509 } 494 510 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionRLDView.cs
r14647 r14652 106 106 }; 107 107 byCostViewHost.Content = byCostDataTable; 108 targetsRelativeCheckBox.Checked = targetsAreRelative; 108 suppressUpdates = true; 109 relativeOrAbsoluteComboBox.SelectedItem = targetsAreRelative ? "relative" : "absolute"; 109 110 problems = new BindingList<ProblemInstance>(); 110 111 problemComboBox.DataSource = new BindingSource() { DataSource = problems }; … … 399 400 } 400 401 } 402 var showMarkers = markerCheckBox.Checked; 401 403 foreach (var list in hits) { 402 404 var row = new Series(list.Key) { 403 405 ChartType = SeriesChartType.StepLine, 404 BorderWidth = 2,406 BorderWidth = 3, 405 407 Color = colors[colorCount], 406 408 BorderDashStyle = lineStyles[lineStyleCount], … … 420 422 if (aggregateTargetsCheckBox.Checked) totalTargets *= targets.Length; 421 423 var movingTargets = totalTargets; 424 var labelPrinted = false; 422 425 foreach (var h in list.Value) { 426 var prevmissedecdf = missedecdf; 423 427 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 } 424 437 missedecdf += iter.Current.Value; 425 438 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) { 427 440 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 } 429 454 if (boundShadingCheckBox.Checked) { 430 455 if (rowShade.Points.Count > 0 && rowShade.Points.Last().XValue == iter.Current.Key) … … 433 458 } 434 459 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 } 435 468 } 436 469 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) { 438 471 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 } 440 484 if (missedecdf > 0 && boundShadingCheckBox.Checked) { 441 485 if (rowShade.Points.Count > 0 && rowShade.Points.Last().XValue == h.Key) … … 445 489 } 446 490 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 447 500 while (moreMisses) { 448 501 // if there are misses beyond the last hit we extend the shaded area 449 502 missedecdf += iter.Current.Value; 450 503 //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) { 452 505 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 } 454 518 if (boundShadingCheckBox.Checked) { 455 519 if (rowShade.Points.Count > 0 && rowShade.Points.Last().XValue == iter.Current.Key) … … 460 524 } 461 525 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); 470 536 } 471 537 … … 651 717 var resultsTable = (IndexedDataTable<double>)run.Results[table]; 652 718 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 { 654 722 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);657 723 } 658 724 } … … 835 901 } 836 902 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) { 839 904 if (suppressUpdates) return; 840 905 var pd = (ProblemInstance)problemComboBox.SelectedItem; … … 851 916 } 852 917 } 853 targetsAreRelative = targetsRelativeCheckBox.Checked;918 targetsAreRelative = (string)relativeOrAbsoluteComboBox.SelectedItem == "relative"; 854 919 SuspendRepaint(); 855 920 suppressTargetsEvents = true; … … 919 984 } 920 985 } 986 987 private void markerCheckBox_CheckedChanged(object sender, EventArgs e) { 988 SuspendRepaint(); 989 try { 990 UpdateResultsByTarget(); 991 } finally { ResumeRepaint(true); } 992 } 921 993 #endregion 922 994 … … 948 1020 } 949 1021 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) { 953 1023 SuspendRepaint(); 954 1024 try {
Note: See TracChangeset
for help on using the changeset viewer.