Changeset 13752
- Timestamp:
- 04/12/16 13:28:23 (9 years ago)
- Location:
- branches/PerformanceComparison
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3/KnowledgeCenter.cs
r13751 r13752 46 46 [Creatable(CreatableAttribute.Categories.TestingAndAnalysis, Priority = 119)] 47 47 public sealed class KnowledgeCenter : IContent { 48 private bool SuppressEvents { get; set; } 48 49 49 50 public string Filename { get; set; } … … 90 91 91 92 private readonly CheckedItemList<StringValue> problemCharacteristics; 92 public CheckedItemList<StringValue> ProblemCharacteristics { 93 get { return problemCharacteristics; } 93 private readonly ReadOnlyCheckedItemList<StringValue> readonlyProblemCharacteristics; 94 public ReadOnlyCheckedItemList<StringValue> ProblemCharacteristics { 95 get { return readonlyProblemCharacteristics; } 94 96 } 95 97 … … 121 123 problemInstances = new RunCollection(); 122 124 problemCharacteristics = new CheckedItemList<StringValue>(); 125 readonlyProblemCharacteristics = problemCharacteristics.AsReadOnly(); 123 126 problem = new SingleObjectiveOKBProblem(); 124 127 algorithmId2RunMapping = new BidirectionalLookup<long, IRun>(); … … 149 152 knowledgeBase.ItemsAdded += InformationChanged; 150 153 knowledgeBase.ItemsRemoved += InformationChanged; 154 problemCharacteristics.ItemsAdded += CharacteristicChanged; 155 problemCharacteristics.ItemsReplaced += CharacteristicChanged; 156 problemCharacteristics.ItemsRemoved += CharacteristicChanged; 157 problemCharacteristics.CollectionReset += CharacteristicChanged; 158 problemCharacteristics.CheckedItemsChanged += CharacteristicChanged; 151 159 } 152 160 … … 168 176 } 169 177 178 private void CharacteristicChanged(object sender, EventArgs e) { 179 if (SuppressEvents) return; 180 UpdateInstanceProjection(); 181 } 182 170 183 public bool IsCurrentInstance(IRun run) { 171 184 if (!problemId2ProblemInstanceMapping.ContainsSecond(run)) return false; … … 177 190 178 191 var instances = new Dictionary<IRun, double[]>(); 192 var values = new List<double>[ProblemCharacteristics.CheckedItems.Count()]; 179 193 foreach (var run in ProblemInstances) { 180 194 var f = 0; 181 195 instances[run] = new double[ProblemCharacteristics.CheckedItems.Count()]; 182 196 foreach (var c in ProblemCharacteristics.CheckedItems.Select(x => x.Value.Value)) { 197 if (values[f] == null) values[f] = new List<double>(ProblemInstances.Count); 183 198 IItem item; 184 199 if (run.Results.TryGetValue(c, out item)) { 185 instances[run][f] = (double)((dynamic)item).Value; 186 } else instances[run][f] = 0; // TODO: handle missing values 200 var val = (double)((dynamic)item).Value; 201 if (!double.IsNaN(val)) values[f].Add(val); 202 instances[run][f] = val; 203 } else instances[run][f] = double.NaN; 187 204 f++; 188 205 } 189 206 } 190 191 var allValues = instances.SelectMany(x => x.Value).ToList(); 192 var avg = allValues.Average(); 193 var stdev = allValues.StandardDeviation(); 207 var median = values.Select(x => x.Count == 0 ? 0.0 : x.Median()).ToList(); 208 209 var allValues = instances.Values.Select(x => x.Select((f, i) => new { Idx = i, Val = double.IsNaN(f) ? median[i] : f }).ToList()) 210 .SelectMany(x => x) 211 .GroupBy(x => x.Idx, x => x.Val) 212 .OrderBy(x => x.Key).ToList(); 213 var avg = allValues.Select(x => x.Average()).ToList(); 214 var stdev = allValues.Select(x => x.StandardDeviation()).ToList(); 194 215 195 216 // normalize characteristic values by transforming them to their z-score … … 197 218 var arr = instances[key]; 198 219 for (var i = 0; i < arr.Length; i++) { 199 arr[i] = (arr[i] - avg) / stdev; 220 if (double.IsNaN(arr[i])) arr[i] = median[i]; 221 if (stdev[i] > 0) arr[i] = (arr[i] - avg[i]) / stdev[i]; 200 222 } 201 223 } … … 396 418 var adminClient = Clients.OKB.Administration.AdministrationClient.Instance; 397 419 try { 398 progress.Status = " Downloading run information...";420 progress.Status = "Connecting to OKB..."; 399 421 progress.ProgressValue = 0; 400 422 // FIXME: How to tell if refresh is necessary? … … 414 436 progress.Status = "Downloading problem instances..."; 415 437 progress.ProgressValue = 0; 416 var p = 0;438 int[] p = { 0 }; 417 439 ProblemInstances.UpdateOfRunsInProgress = true; 418 440 ProblemInstances.Clear(); 419 441 var characteristics = new HashSet<string>(); 420 442 var totalProblems = adminClient.Problems.Count(x => x.ProblemClassId == probClassId); 421 foreach (var problInst in adminClient.Problems.Where(x => x.ProblemClassId == probClassId)) { 422 progress.Status = string.Format("Downloading problem {0} (okb-id: {1})....", problInst.Name, problInst.Id); 423 var data = Clients.OKB.Administration.AdministrationClient.GetProblemData(problInst.Id); 443 Parallel.ForEach(adminClient.Problems.Where(x => x.ProblemClassId == probClassId), (pInst) => { 444 var charas = new List<string>(); 445 IRun probRun = null; 446 var data = Clients.OKB.Administration.AdministrationClient.GetProblemData(pInst.Id); 424 447 if (data != null) { 425 448 using (var stream = new MemoryStream(data)) { 426 449 try { 427 450 var prob = (IProblem)XmlParser.Deserialize<IContent>(stream); 428 varprobRun = new Run() { Name = prob.Name };451 probRun = new Run() { Name = prob.Name }; 429 452 prob.CollectParameterValues(probRun.Parameters); 430 453 probRun.Parameters["Problem Name"] = new StringValue(prob.Name); 431 454 probRun.Parameters["Problem Type"] = new StringValue(prob.GetType().Name); 432 progress.Status += Environment.NewLine + "Downloading characteristics..."; 433 foreach (var v in RunCreationClient.Instance.GetCharacteristicValues(problInst.Id)) { 455 foreach (var v in RunCreationClient.Instance.GetCharacteristicValues(pInst.Id)) { 434 456 probRun.Results.Add("Characteristic." + v.Name, RunCreationClient.Instance.ConvertToItem(v)); 435 chara cteristics.Add(v.Name);457 charas.Add("Characteristic." + v.Name); 436 458 } 437 ProblemInstances.Add(probRun);438 problemId2ProblemInstanceMapping.Add(problInst.Id, probRun);439 459 } catch { } 440 460 stream.Close(); 441 461 } 442 } 443 p++; 444 progress.ProgressValue = p / (double)totalProblems; 445 } 462 if (probRun != null) { 463 lock (characteristics) { 464 problemId2ProblemInstanceMapping.Add(pInst.Id, probRun); 465 ProblemInstances.Add(probRun); 466 progress.Status = string.Format("Downloaded problem {0} (okb-id: {1})....", pInst.Name, pInst.Id); 467 p[0]++; 468 progress.ProgressValue = p[0] / (double)totalProblems; 469 foreach (var c in charas) characteristics.Add(c); 470 } 471 } 472 } 473 }); 446 474 447 475 algorithmId2AlgorithmInstanceMapping.Clear(); 448 476 progress.Status = "Downloading algorithm instances..."; 449 477 progress.ProgressValue = 0; 450 p = 0;451 foreach (var algInst in adminClient.Algorithms){452 progress.Status = string.Format("Downloading algorithm {0} (okb-id: {1})...", algInst.Name, algInst.Id);478 p[0] = 0; 479 Parallel.ForEach(adminClient.Algorithms, (algInst) => { 480 IAlgorithm alg = null; 453 481 var data = Clients.OKB.Administration.AdministrationClient.GetAlgorithmData(algInst.Id); 454 482 if (data != null) { 455 483 using (var stream = new MemoryStream(data)) { 456 484 try { 457 var alg = (IAlgorithm)XmlParser.Deserialize<IContent>(stream); 458 algorithmId2AlgorithmInstanceMapping.Add(algInst.Id, alg); 485 alg = (IAlgorithm)XmlParser.Deserialize<IContent>(stream); 459 486 } catch { } 460 487 stream.Close(); 461 488 } 462 } 463 p++; 464 progress.ProgressValue = p / (double)adminClient.Algorithms.Count; 465 } 489 if (alg != null) { 490 lock (algorithmId2AlgorithmInstanceMapping) { 491 algorithmId2AlgorithmInstanceMapping.Add(algInst.Id, alg); 492 progress.Status = string.Format("Downloaded algorithm {0} (okb-id: {1})...", algInst.Name, algInst.Id); 493 p[0]++; 494 progress.ProgressValue = p[0] / (double)adminClient.Algorithms.Count; 495 } 496 } 497 } 498 }); 466 499 467 500 var interestingValues = queryClient.ValueNames.Where(x => InterestingValueNames.Contains(x.Name)).ToList(); 468 501 469 progress.Status = " Obtaining number ofruns...";502 progress.Status = "Downloading runs..."; 470 503 progress.ProgressValue = 0; 471 p = 0;504 p[0] = 0; 472 505 var count = queryClient.GetNumberOfRuns(problemClassFilter); 473 506 if (count == 0) return; 474 507 508 var runList = new List<IRun>(); 475 509 var runIds = queryClient.GetRunIds(problemClassFilter).ToList(); 476 var conversions = new List<Task>(); 477 var runList = new List<IRun>(); 478 while (p < count) { 479 var nextIds = runIds.Skip(p).Take(500).ToList(); 480 progress.Status = string.Format("Downloading runs {0} to {1} of {2}...", p, p + nextIds.Count, count); 481 var okbRuns = queryClient.GetRunsWithValues(nextIds, true, interestingValues); 482 conversions.Add(Task.Factory.StartNew(() => { 483 var hlRuns = okbRuns.AsParallel().Select(x => new { AlgorithmId = x.Algorithm.Id, Run = queryClient.ConvertToOptimizationRun(x) }).ToList(); 484 lock (runList) { 485 foreach (var r in hlRuns) { 486 algorithmId2RunMapping.Add(r.AlgorithmId, r.Run); 487 runList.Add(r.Run); 488 } 489 } 490 })); 491 p += nextIds.Count; 492 progress.ProgressValue = p / (double)count; 493 } 494 Task.WaitAll(conversions.ToArray()); 510 var batches = runIds.Select((v, i) => new { Idx = i, Val = v }).GroupBy(x => x.Idx / 500, x => x.Val); 511 Parallel.ForEach(batches.Select(x => x.ToList()), (batch) => { 512 var okbRuns = queryClient.GetRunsWithValues(batch, true, interestingValues); 513 var hlRuns = okbRuns.AsParallel().Select(x => new { AlgorithmId = x.Algorithm.Id, Run = queryClient.ConvertToOptimizationRun(x) }).ToList(); 514 lock (runList) { 515 foreach (var r in hlRuns) { 516 algorithmId2RunMapping.Add(r.AlgorithmId, r.Run); 517 runList.Add(r.Run); 518 } 519 progress.Status = string.Format("Downloaded runs {0} to {1} of {2}...", p[0], p[0] + batch.Count, count); 520 p[0] += batch.Count; 521 progress.ProgressValue = p[0] / (double)count; 522 } 523 }); 495 524 496 525 progress.Status = "Finishing..."; … … 534 563 } 535 564 } 536 ProblemCharacteristics.Replace(characteristics.Select(x => new StringValue(x))); 565 try { 566 SuppressEvents = true; 567 problemCharacteristics.Replace(characteristics.Select(x => new StringValue(x))); 568 foreach (var pc in problemCharacteristics.Where(x => !x.Value.StartsWith("Characteristic."))) 569 problemCharacteristics.SetItemCheckedState(pc, false); 570 } finally { SuppressEvents = false; } 537 571 try { 538 572 KnowledgeBase.UpdateOfRunsInProgress = true; -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/KnowledgeCenterViewBase.cs
r13722 r13752 50 50 RegisterContentProblemEvents(); 51 51 RegisterContentProblemInstancesEvents(); 52 RegisterContentProblemCharacteristicsEvents(); 52 53 RegisterContentSolutionSeedingPoolEvents(); 53 54 RegisterContentSuggestedInstancesEvents(); … … 70 71 } 71 72 73 private void RegisterContentProblemCharacteristicsEvents() { 74 Content.ProblemCharacteristics.ItemsAdded += ContentOnProblemCharacteristicsChanged; 75 Content.ProblemCharacteristics.ItemsReplaced += ContentOnProblemCharacteristicsChanged; 76 Content.ProblemCharacteristics.ItemsRemoved += ContentOnProblemCharacteristicsChanged; 77 Content.ProblemCharacteristics.CheckedItemsChanged += ContentOnProblemCharacteristicsChanged; 78 Content.ProblemCharacteristics.CollectionReset += ContentOnProblemCharacteristicsChanged; 79 } 80 72 81 private void RegisterContentSolutionSeedingPoolEvents() { 73 82 Content.SolutionSeedingPool.CheckedItemsChanged += ContentOnSolutionSeedingPoolChanged; … … 92 101 DeregisterContentProblemEvents(); 93 102 DeregisterContentProblemInstancesEvents(); 103 DeregisterContentProblemCharacteristicsEvents(); 94 104 DeregisterContentSolutionSeedingPoolEvents(); 95 105 DeregisterContentSuggestedInstancesEvents(); … … 110 120 Content.ProblemInstances.CollectionReset -= ContentOnProblemInstancesChanged; 111 121 Content.ProblemInstances.ItemChanged -= ContentOnProblemInstancesChanged; 122 } 123 124 private void DeregisterContentProblemCharacteristicsEvents() { 125 Content.ProblemCharacteristics.ItemsAdded -= ContentOnProblemCharacteristicsChanged; 126 Content.ProblemCharacteristics.ItemsReplaced -= ContentOnProblemCharacteristicsChanged; 127 Content.ProblemCharacteristics.ItemsRemoved -= ContentOnProblemCharacteristicsChanged; 128 Content.ProblemCharacteristics.CheckedItemsChanged -= ContentOnProblemCharacteristicsChanged; 129 Content.ProblemCharacteristics.CollectionReset -= ContentOnProblemCharacteristicsChanged; 112 130 } 113 131 … … 136 154 protected virtual void OnProblemSolutionsChanged() { } 137 155 protected virtual void OnProblemInstancesChanged() { } 156 protected virtual void OnProblemCharacteristicsChanged() { } 138 157 protected virtual void OnSolutionSeedingPoolChanged() { } 139 158 protected virtual void OnSuggestedInstancesChanged() { } … … 175 194 } 176 195 196 private void ContentOnProblemCharacteristicsChanged(object sender, EventArgs e) { 197 if (InvokeRequired) Invoke((Action)OnProblemCharacteristicsChanged); 198 else OnProblemCharacteristicsChanged(); 199 } 200 177 201 private void ContentOnSolutionSeedingPoolChanged(object sender, EventArgs e) { 178 202 if (InvokeRequired) Invoke((Action)OnSolutionSeedingPoolChanged); -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/UnderstandingProblemInstanceView.Designer.cs
r13751 r13752 52 52 this.problemInstancesTabControl = new HeuristicLab.MainForm.WindowsForms.DragOverTabControl(); 53 53 this.mapTabPage = new System.Windows.Forms.TabPage(); 54 this.instancesTabPage = new System.Windows.Forms.TabPage();55 this.problemInstancesView = new HeuristicLab.MainForm.WindowsForms.ViewHost();56 54 this.mapSplitContainer = new System.Windows.Forms.SplitContainer(); 55 this.showCharacteristicsCheckBox = new System.Windows.Forms.CheckBox(); 57 56 this.invPropCheckBox = new System.Windows.Forms.CheckBox(); 58 57 this.sizeLabel = new System.Windows.Forms.Label(); … … 61 60 this.sizeComboBox = new System.Windows.Forms.ComboBox(); 62 61 this.projectionComboBox = new System.Windows.Forms.ComboBox(); 63 this.showCharacteristicsCheckBox = new System.Windows.Forms.CheckBox(); 62 this.instancesTabPage = new System.Windows.Forms.TabPage(); 63 this.problemInstancesView = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 64 64 this.problemInstancesTabControl.SuspendLayout(); 65 65 this.mapTabPage.SuspendLayout(); 66 this.instancesTabPage.SuspendLayout();67 66 ((System.ComponentModel.ISupportInitialize)(this.mapSplitContainer)).BeginInit(); 68 67 this.mapSplitContainer.Panel1.SuspendLayout(); 69 68 this.mapSplitContainer.SuspendLayout(); 70 69 ((System.ComponentModel.ISupportInitialize)(this.instanceMapChart)).BeginInit(); 70 this.instancesTabPage.SuspendLayout(); 71 71 this.SuspendLayout(); 72 72 // … … 96 96 this.mapTabPage.UseVisualStyleBackColor = true; 97 97 // 98 // instancesTabPage99 //100 this.instancesTabPage.Controls.Add(this.problemInstancesView);101 this.instancesTabPage.Location = new System.Drawing.Point(4, 22);102 this.instancesTabPage.Name = "instancesTabPage";103 this.instancesTabPage.Padding = new System.Windows.Forms.Padding(3);104 this.instancesTabPage.Size = new System.Drawing.Size(992, 734);105 this.instancesTabPage.TabIndex = 0;106 this.instancesTabPage.Text = "Instances";107 this.instancesTabPage.UseVisualStyleBackColor = true;108 //109 // problemInstancesView110 //111 this.problemInstancesView.Caption = "View";112 this.problemInstancesView.Content = null;113 this.problemInstancesView.Dock = System.Windows.Forms.DockStyle.Fill;114 this.problemInstancesView.Enabled = false;115 this.problemInstancesView.Location = new System.Drawing.Point(3, 3);116 this.problemInstancesView.Name = "problemInstancesView";117 this.problemInstancesView.ReadOnly = false;118 this.problemInstancesView.Size = new System.Drawing.Size(986, 728);119 this.problemInstancesView.TabIndex = 0;120 this.problemInstancesView.ViewsLabelVisible = true;121 this.problemInstancesView.ViewType = null;122 //123 98 // mapSplitContainer 124 99 // … … 138 113 this.mapSplitContainer.Panel1.Controls.Add(this.projectionComboBox); 139 114 this.mapSplitContainer.Panel1.Padding = new System.Windows.Forms.Padding(0, 3, 0, 0); 115 this.mapSplitContainer.Panel2Collapsed = true; 140 116 this.mapSplitContainer.Size = new System.Drawing.Size(986, 728); 141 117 this.mapSplitContainer.SplitterDistance = 847; 142 118 this.mapSplitContainer.TabIndex = 12; 119 // 120 // showCharacteristicsCheckBox 121 // 122 this.showCharacteristicsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 123 this.showCharacteristicsCheckBox.Appearance = System.Windows.Forms.Appearance.Button; 124 this.showCharacteristicsCheckBox.Location = new System.Drawing.Point(957, 4); 125 this.showCharacteristicsCheckBox.Name = "showCharacteristicsCheckBox"; 126 this.showCharacteristicsCheckBox.Size = new System.Drawing.Size(26, 23); 127 this.showCharacteristicsCheckBox.TabIndex = 18; 128 this.showCharacteristicsCheckBox.Text = "Detail"; 129 this.showCharacteristicsCheckBox.UseVisualStyleBackColor = true; 130 this.showCharacteristicsCheckBox.CheckedChanged += new System.EventHandler(this.showCharacteristicsCheckBox_CheckedChanged); 143 131 // 144 132 // invPropCheckBox … … 153 141 this.invPropCheckBox.Text = "inverse proportional"; 154 142 this.invPropCheckBox.UseVisualStyleBackColor = true; 143 this.invPropCheckBox.CheckedChanged += new System.EventHandler(this.InvPropCheckBoxOnCheckedChanged); 155 144 // 156 145 // sizeLabel … … 203 192 this.instanceMapChart.Series.Add(series1); 204 193 this.instanceMapChart.Series.Add(series2); 205 this.instanceMapChart.Size = new System.Drawing.Size( 841, 692);194 this.instanceMapChart.Size = new System.Drawing.Size(980, 692); 206 195 this.instanceMapChart.TabIndex = 12; 207 196 // … … 214 203 this.sizeComboBox.Size = new System.Drawing.Size(273, 21); 215 204 this.sizeComboBox.TabIndex = 13; 205 this.sizeComboBox.SelectedIndexChanged += new System.EventHandler(this.SizeComboBoxOnSelectedIndexChanged); 216 206 // 217 207 // projectionComboBox … … 223 213 this.projectionComboBox.Size = new System.Drawing.Size(158, 21); 224 214 this.projectionComboBox.TabIndex = 14; 225 // 226 // showCharacteristicsCheckBox 227 // 228 this.showCharacteristicsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 229 this.showCharacteristicsCheckBox.Appearance = System.Windows.Forms.Appearance.Button; 230 this.showCharacteristicsCheckBox.Location = new System.Drawing.Point(818, 4); 231 this.showCharacteristicsCheckBox.Name = "showCharacteristicsCheckBox"; 232 this.showCharacteristicsCheckBox.Size = new System.Drawing.Size(26, 23); 233 this.showCharacteristicsCheckBox.TabIndex = 18; 234 this.showCharacteristicsCheckBox.Text = "Detail"; 235 this.showCharacteristicsCheckBox.UseVisualStyleBackColor = true; 215 this.projectionComboBox.SelectedIndexChanged += new System.EventHandler(this.ProjectionComboBoxOnSelectedIndexChanged); 216 // 217 // instancesTabPage 218 // 219 this.instancesTabPage.Controls.Add(this.problemInstancesView); 220 this.instancesTabPage.Location = new System.Drawing.Point(4, 22); 221 this.instancesTabPage.Name = "instancesTabPage"; 222 this.instancesTabPage.Padding = new System.Windows.Forms.Padding(3); 223 this.instancesTabPage.Size = new System.Drawing.Size(992, 734); 224 this.instancesTabPage.TabIndex = 0; 225 this.instancesTabPage.Text = "Instances"; 226 this.instancesTabPage.UseVisualStyleBackColor = true; 227 // 228 // problemInstancesView 229 // 230 this.problemInstancesView.Caption = "View"; 231 this.problemInstancesView.Content = null; 232 this.problemInstancesView.Dock = System.Windows.Forms.DockStyle.Fill; 233 this.problemInstancesView.Enabled = false; 234 this.problemInstancesView.Location = new System.Drawing.Point(3, 3); 235 this.problemInstancesView.Name = "problemInstancesView"; 236 this.problemInstancesView.ReadOnly = false; 237 this.problemInstancesView.Size = new System.Drawing.Size(986, 728); 238 this.problemInstancesView.TabIndex = 0; 239 this.problemInstancesView.ViewsLabelVisible = true; 240 this.problemInstancesView.ViewType = null; 236 241 // 237 242 // UnderstandingProblemInstanceView … … 244 249 this.problemInstancesTabControl.ResumeLayout(false); 245 250 this.mapTabPage.ResumeLayout(false); 246 this.instancesTabPage.ResumeLayout(false);247 251 this.mapSplitContainer.Panel1.ResumeLayout(false); 248 252 this.mapSplitContainer.Panel1.PerformLayout(); … … 250 254 this.mapSplitContainer.ResumeLayout(false); 251 255 ((System.ComponentModel.ISupportInitialize)(this.instanceMapChart)).EndInit(); 256 this.instancesTabPage.ResumeLayout(false); 252 257 this.ResumeLayout(false); 253 258 -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/UnderstandingProblemInstanceView.cs
r13751 r13752 20 20 #endregion 21 21 22 using HeuristicLab.Common.Resources; 22 23 using HeuristicLab.Core; 24 using HeuristicLab.Core.Views; 25 using HeuristicLab.Data; 23 26 using HeuristicLab.MainForm; 24 27 using HeuristicLab.OptimizationExpertSystem.Common; … … 27 30 using System.Linq; 28 31 using System.Text.RegularExpressions; 32 using System.Windows.Forms; 29 33 using System.Windows.Forms.DataVisualization.Charting; 30 34 … … 34 38 public sealed partial class UnderstandingProblemInstanceView : KnowledgeCenterViewBase { 35 39 private bool SuppressEvents { get; set; } 36 40 private readonly CheckedItemListView<StringValue> characteristicsView; 41 37 42 public UnderstandingProblemInstanceView() { 38 43 InitializeComponent(); 44 showCharacteristicsCheckBox.Text = string.Empty; 45 showCharacteristicsCheckBox.Image = VSImageLibrary.Properties; 46 characteristicsView = new CheckedItemListView<StringValue>() { 47 Dock = DockStyle.Fill 48 }; 49 mapSplitContainer.Panel2.Controls.Add(characteristicsView); 39 50 } 40 51 … … 43 54 if (Content == null) { 44 55 problemInstancesView.Content = null; 56 characteristicsView.Content = null; 45 57 instanceMapChart.Series["InstancesSeries"].Points.Clear(); 46 58 instanceMapChart.Series["CurrentInstanceSeries"].Points.Clear(); 47 59 } else { 48 60 problemInstancesView.Content = Content.ProblemInstances; 61 characteristicsView.Content = Content.ProblemCharacteristics; 49 62 UpdateProjectionComboBox(); 50 63 UpdateSizeComboBox(); … … 175 188 UpdateProjection(); 176 189 } 190 191 private void showCharacteristicsCheckBox_CheckedChanged(object sender, EventArgs e) { 192 mapSplitContainer.Panel2Collapsed = !showCharacteristicsCheckBox.Checked; 193 } 177 194 #endregion 178 195 }
Note: See TracChangeset
for help on using the changeset viewer.