Changeset 12888
- Timestamp:
- 08/20/15 08:56:15 (9 years ago)
- Location:
- branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionRLDView.Designer.cs
r12841 r12888 69 69 this.byCostViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 70 70 this.byTableTabPage = new System.Windows.Forms.TabPage(); 71 this.ertViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();72 71 this.problemComboBox = new System.Windows.Forms.ComboBox(); 73 72 this.problemLabel = new System.Windows.Forms.Label(); 73 this.ertTableView = new HeuristicLab.Data.Views.StringConvertibleMatrixView(); 74 74 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 75 75 this.tabControl.SuspendLayout(); … … 137 137 this.targetsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 138 138 | System.Windows.Forms.AnchorStyles.Right))); 139 this.targetsTextBox.Location = new System.Drawing.Point( 65, 8);139 this.targetsTextBox.Location = new System.Drawing.Point(59, 8); 140 140 this.targetsTextBox.Name = "targetsTextBox"; 141 this.targetsTextBox.Size = new System.Drawing.Size(32 0, 20);141 this.targetsTextBox.Size = new System.Drawing.Size(326, 20); 142 142 this.targetsTextBox.TabIndex = 1; 143 143 this.toolTip.SetToolTip(this.targetsTextBox, "The order of the targets is important, first to-hit targets\r\nshould be given firs" + … … 194 194 this.budgetsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 195 195 | System.Windows.Forms.AnchorStyles.Right))); 196 this.budgetsTextBox.Location = new System.Drawing.Point( 65, 8);196 this.budgetsTextBox.Location = new System.Drawing.Point(59, 8); 197 197 this.budgetsTextBox.Name = "budgetsTextBox"; 198 this.budgetsTextBox.Size = new System.Drawing.Size(32 0, 20);198 this.budgetsTextBox.Size = new System.Drawing.Size(326, 20); 199 199 this.budgetsTextBox.TabIndex = 6; 200 200 this.budgetsTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.budgetsTextBox_Validating); … … 340 340 // byTableTabPage 341 341 // 342 this.byTableTabPage.Controls.Add(this.ert ViewHost);342 this.byTableTabPage.Controls.Add(this.ertTableView); 343 343 this.byTableTabPage.Location = new System.Drawing.Point(4, 22); 344 344 this.byTableTabPage.Name = "byTableTabPage"; … … 349 349 this.byTableTabPage.UseVisualStyleBackColor = true; 350 350 // 351 // ertViewHost352 //353 this.ertViewHost.Caption = "View";354 this.ertViewHost.Content = null;355 this.ertViewHost.Dock = System.Windows.Forms.DockStyle.Fill;356 this.ertViewHost.Enabled = false;357 this.ertViewHost.Location = new System.Drawing.Point(3, 3);358 this.ertViewHost.Name = "ertViewHost";359 this.ertViewHost.ReadOnly = false;360 this.ertViewHost.Size = new System.Drawing.Size(640, 381);361 this.ertViewHost.TabIndex = 0;362 this.ertViewHost.ViewsLabelVisible = true;363 this.ertViewHost.ViewType = null;364 //365 351 // problemComboBox 366 352 // … … 383 369 this.problemLabel.TabIndex = 2; 384 370 this.problemLabel.Text = "Problem:"; 371 // 372 // ertTableView 373 // 374 this.ertTableView.Caption = "StringConvertibleMatrix View"; 375 this.ertTableView.Content = null; 376 this.ertTableView.Dock = System.Windows.Forms.DockStyle.Fill; 377 this.ertTableView.Location = new System.Drawing.Point(3, 3); 378 this.ertTableView.Name = "ertTableView"; 379 this.ertTableView.ReadOnly = false; 380 this.ertTableView.ShowRowsAndColumnsTextBox = false; 381 this.ertTableView.ShowStatisticalInformation = false; 382 this.ertTableView.Size = new System.Drawing.Size(640, 381); 383 this.ertTableView.TabIndex = 0; 385 384 // 386 385 // RunCollectionRLDView … … 434 433 private System.Windows.Forms.Button generateBudgetsButton; 435 434 private System.Windows.Forms.CheckBox budgetLogScalingCheckBox; 436 private MainForm.WindowsForms.ViewHost ertViewHost;437 435 private System.Windows.Forms.Label problemLabel; 438 436 private System.Windows.Forms.ComboBox problemComboBox; 437 private Data.Views.StringConvertibleMatrixView ertTableView; 439 438 } 440 439 } -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionRLDView.cs
r12865 r12888 93 93 byCostDataTable = new IndexedDataTable<double>("ECDF by Cost", "A data table containing the ECDF of each of a number of groups.") { 94 94 VisualProperties = { 95 YAxisTitle = "Proportion of required budgets",95 YAxisTitle = "Proportion of unused budgets", 96 96 YAxisMinimumFixedValue = 0, YAxisMinimumAuto = false, 97 97 YAxisMaximumFixedValue = 1, YAxisMaximumAuto = false … … 280 280 var maximization = IsMaximization(); 281 281 282 var targetsPerProblem = (from r in Content 283 let pd = new ProblemDescription(r).ToString() 284 let target = r.Parameters.ContainsKey("BestKnownQuality") 285 && r.Parameters["BestKnownQuality"] is DoubleValue 286 ? ((DoubleValue)r.Parameters["BestKnownQuality"]).Value 287 : ((IndexedDataTable<double>)r.Results[table]).Rows.First().Values.Last().Item2 288 group target by pd into g 289 select new { Problem = g.Key, Target = maximization ? g.Max() : g.Min() }) 290 .ToDictionary(x => x.Problem, x => x.Target); 282 var targetsPerProblem = CalculateBestTargetPerProblemInstance(table, maximization); 291 283 292 284 foreach (var x in (from r in Content 293 where selectedGroup == AllRuns || r.Parameters.ContainsKey(selectedGroup)285 where (selectedGroup == AllRuns || r.Parameters.ContainsKey(selectedGroup)) 294 286 && selectedProblem.Match(r) 295 287 && r.Results.ContainsKey(table) … … 310 302 } 311 303 312 private void UpdateRuns() {313 if (InvokeRequired) {314 Invoke((Action)UpdateRuns);315 return;316 }317 SuspendRepaint();318 try {319 UpdateResultsByTarget();320 UpdateResultsByCost();321 } finally { ResumeRepaint(true); }322 }323 324 304 #region Performance analysis by (multiple) target(s) 325 305 private void UpdateResultsByTarget() { … … 383 363 } 384 364 365 if (targets.Length == 1) 366 ByTargetDataTable.VisualProperties.YAxisTitle = "Probability to be " + (targets[0] * 100) + "% worse than best"; 367 else ByTargetDataTable.VisualProperties.YAxisTitle = "Proportion of reached targets"; 385 368 byTargetDataTable.VisualProperties.XAxisTitle = string.Join(" / ", xAxisTitles); 386 369 byTargetDataTable.VisualProperties.XAxisLogScale = byTargetDataTable.Rows.Count > 0 && targetLogScalingCheckBox.Checked; … … 392 375 targets = new[] { 0.1, 0.05, 0.02, 0.01, 0 }; 393 376 suppressTargetsEvents = true; 394 targetsTextBox.Text = string.Join("% ; ", targets.Select(x => x * 100)) ;377 targetsTextBox.Text = string.Join("% ; ", targets.Select(x => x * 100)) + "%"; 395 378 suppressTargetsEvents = false; 396 379 } … … 434 417 435 418 private void UpdateErtTables(Dictionary<string, Dictionary<string, Tuple<double, List<IRun>>>> groupedRuns) { 436 ert ViewHost.Content = null;419 ertTableView.Content = null; 437 420 var columns = 1 + targets.Length + 1; 438 421 var matrix = new string[groupedRuns.Count * groupedRuns.Max(x => x.Value.Count) + groupedRuns.Max(x => x.Value.Count), columns]; … … 440 423 var maximization = IsMaximization(); 441 424 442 443 var targetsPerProblem = (from r in Content 444 let pd = new ProblemDescription(r).ToString() 445 let target = r.Parameters.ContainsKey("BestKnownQuality") 446 && r.Parameters["BestKnownQuality"] is DoubleValue 447 ? ((DoubleValue)r.Parameters["BestKnownQuality"]).Value 448 : ((IndexedDataTable<double>)r.Results[(string)dataTableComboBox.SelectedItem]).Rows.First().Values.Last().Item2 449 group target by pd into g 450 select new { Problem = g.Key, Target = maximization ? g.Max() : g.Min() }) 451 .ToDictionary(x => x.Problem, x => x.Target); 425 var targetsPerProblem = CalculateBestTargetPerProblemInstance((string)dataTableComboBox.SelectedItem, maximization); 452 426 453 427 var colNames = new string[columns]; … … 479 453 } 480 454 } 481 ertViewHost.Content = new StringMatrix(matrix) { ColumnNames = colNames }; 455 ertTableView.Content = new StringMatrix(matrix) { ColumnNames = colNames }; 456 ertTableView.DataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells); 482 457 } 483 458 … … 527 502 528 503 var maximization = IsMaximization(); 529 var targetsPerProblem = (from r in Content 530 let pd = new ProblemDescription(r).ToString() 531 let target = r.Parameters.ContainsKey("BestKnownQuality") 532 && r.Parameters["BestKnownQuality"] is DoubleValue 533 ? ((DoubleValue)r.Parameters["BestKnownQuality"]).Value 534 : ((IndexedDataTable<double>)r.Results[(string)dataTableComboBox.SelectedItem]).Rows.First().Values.Last().Item2 535 group target by pd into g 536 select new { Problem = g.Key, Target = maximization ? g.Max() : g.Min() }) 537 .ToDictionary(x => x.Problem, x => x.Target); 504 var targetsPerProblem = CalculateBestTargetPerProblemInstance((string)dataTableComboBox.SelectedItem, maximization); 538 505 539 506 foreach (var group in groupedRuns) { … … 699 666 e.Cancel = false; 700 667 errorProvider.SetError(targetsTextBox, null); 701 targets = targetList.Select(x => (double)x).ToArray(); 668 targets = targetList.Select(x => (double)x).OrderByDescending(x => x).ToArray(); 669 suppressTargetsEvents = true; 670 try { targetsTextBox.Text = string.Join("% ; ", targets.Select(x => x * 100)) + "%"; } finally { suppressTargetsEvents = false; } 671 702 672 UpdateResultsByTarget(); 703 673 SetEnabledStateOfControls(); … … 746 716 var maximization = IsMaximization(); 747 717 748 var targetsPerProblem = (from r in Content 749 let pd = new ProblemDescription(r).ToString() 750 let target = r.Parameters.ContainsKey("BestKnownQuality") 751 && r.Parameters["BestKnownQuality"] is DoubleValue 752 ? ((DoubleValue)r.Parameters["BestKnownQuality"]).Value 753 : ((IndexedDataTable<double>)r.Results[table]).Rows.First().Values.Last().Item2 754 group target by pd into g 755 select new { Problem = g.Key, Target = maximization ? g.Max() : g.Min() }) 756 .ToDictionary(x => x.Problem, x => x.Target); 718 var targetsPerProblem = CalculateBestTargetPerProblemInstance(table, maximization); 757 719 758 720 foreach (var run in Content) { … … 911 873 return false; 912 874 } 875 876 private Dictionary<string, double> CalculateBestTargetPerProblemInstance(string table, bool maximization) { 877 return (from r in Content 878 where r.Visible 879 let pd = new ProblemDescription(r).ToString() 880 let target = r.Parameters.ContainsKey("BestKnownQuality") 881 && r.Parameters["BestKnownQuality"] is DoubleValue 882 ? ((DoubleValue)r.Parameters["BestKnownQuality"]).Value 883 : ((IndexedDataTable<double>)r.Results[table]).Rows.First().Values.Last().Item2 884 group target by pd into g 885 select new { Problem = g.Key, Target = maximization ? g.Max() : g.Min() }) 886 .ToDictionary(x => x.Problem, x => x.Target); 887 } 888 889 private void UpdateRuns() { 890 if (InvokeRequired) { 891 Invoke((Action)UpdateRuns); 892 return; 893 } 894 SuspendRepaint(); 895 try { 896 UpdateResultsByTarget(); 897 UpdateResultsByCost(); 898 } finally { ResumeRepaint(true); } 899 } 913 900 #endregion 914 901
Note: See TracChangeset
for help on using the changeset viewer.