Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13752


Ignore:
Timestamp:
04/12/16 13:28:23 (8 years ago)
Author:
abeham
Message:

#2457:

  • improved mapping of problem instances by normalization (z-score) and handling of missing values (median)
  • enabled to select the characteristics that should be included in the mapping
  • improved speed of OKB download by calling service methods in parallel
Location:
branches/PerformanceComparison
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3/KnowledgeCenter.cs

    r13751 r13752  
    4646  [Creatable(CreatableAttribute.Categories.TestingAndAnalysis, Priority = 119)]
    4747  public sealed class KnowledgeCenter : IContent {
     48    private bool SuppressEvents { get; set; }
    4849
    4950    public string Filename { get; set; }
     
    9091
    9192    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; }
    9496    }
    9597
     
    121123      problemInstances = new RunCollection();
    122124      problemCharacteristics = new CheckedItemList<StringValue>();
     125      readonlyProblemCharacteristics = problemCharacteristics.AsReadOnly();
    123126      problem = new SingleObjectiveOKBProblem();
    124127      algorithmId2RunMapping = new BidirectionalLookup<long, IRun>();
     
    149152      knowledgeBase.ItemsAdded += InformationChanged;
    150153      knowledgeBase.ItemsRemoved += InformationChanged;
     154      problemCharacteristics.ItemsAdded += CharacteristicChanged;
     155      problemCharacteristics.ItemsReplaced += CharacteristicChanged;
     156      problemCharacteristics.ItemsRemoved += CharacteristicChanged;
     157      problemCharacteristics.CollectionReset += CharacteristicChanged;
     158      problemCharacteristics.CheckedItemsChanged += CharacteristicChanged;
    151159    }
    152160
     
    168176    }
    169177
     178    private void CharacteristicChanged(object sender, EventArgs e) {
     179      if (SuppressEvents) return;
     180      UpdateInstanceProjection();
     181    }
     182
    170183    public bool IsCurrentInstance(IRun run) {
    171184      if (!problemId2ProblemInstanceMapping.ContainsSecond(run)) return false;
     
    177190
    178191      var instances = new Dictionary<IRun, double[]>();
     192      var values = new List<double>[ProblemCharacteristics.CheckedItems.Count()];
    179193      foreach (var run in ProblemInstances) {
    180194        var f = 0;
    181195        instances[run] = new double[ProblemCharacteristics.CheckedItems.Count()];
    182196        foreach (var c in ProblemCharacteristics.CheckedItems.Select(x => x.Value.Value)) {
     197          if (values[f] == null) values[f] = new List<double>(ProblemInstances.Count);
    183198          IItem item;
    184199          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;
    187204          f++;
    188205        }
    189206      }
    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();
    194215
    195216      // normalize characteristic values by transforming them to their z-score
     
    197218        var arr = instances[key];
    198219        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];
    200222        }
    201223      }
     
    396418      var adminClient = Clients.OKB.Administration.AdministrationClient.Instance;
    397419      try {
    398         progress.Status = "Downloading run information...";
     420        progress.Status = "Connecting to OKB...";
    399421        progress.ProgressValue = 0;
    400422        // FIXME: How to tell if refresh is necessary?
     
    414436        progress.Status = "Downloading problem instances...";
    415437        progress.ProgressValue = 0;
    416         var p = 0;
     438        int[] p = { 0 };
    417439        ProblemInstances.UpdateOfRunsInProgress = true;
    418440        ProblemInstances.Clear();
    419441        var characteristics = new HashSet<string>();
    420442        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);
    424447          if (data != null) {
    425448            using (var stream = new MemoryStream(data)) {
    426449              try {
    427450                var prob = (IProblem)XmlParser.Deserialize<IContent>(stream);
    428                 var probRun = new Run() { Name = prob.Name };
     451                probRun = new Run() { Name = prob.Name };
    429452                prob.CollectParameterValues(probRun.Parameters);
    430453                probRun.Parameters["Problem Name"] = new StringValue(prob.Name);
    431454                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)) {
    434456                  probRun.Results.Add("Characteristic." + v.Name, RunCreationClient.Instance.ConvertToItem(v));
    435                   characteristics.Add(v.Name);
     457                  charas.Add("Characteristic." + v.Name);
    436458                }
    437                 ProblemInstances.Add(probRun);
    438                 problemId2ProblemInstanceMapping.Add(problInst.Id, probRun);
    439459              } catch { }
    440460              stream.Close();
    441461            }
    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        });
    446474
    447475        algorithmId2AlgorithmInstanceMapping.Clear();
    448476        progress.Status = "Downloading algorithm instances...";
    449477        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;
    453481          var data = Clients.OKB.Administration.AdministrationClient.GetAlgorithmData(algInst.Id);
    454482          if (data != null) {
    455483            using (var stream = new MemoryStream(data)) {
    456484              try {
    457                 var alg = (IAlgorithm)XmlParser.Deserialize<IContent>(stream);
    458                 algorithmId2AlgorithmInstanceMapping.Add(algInst.Id, alg);
     485                alg = (IAlgorithm)XmlParser.Deserialize<IContent>(stream);
    459486              } catch { }
    460487              stream.Close();
    461488            }
    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        });
    466499
    467500        var interestingValues = queryClient.ValueNames.Where(x => InterestingValueNames.Contains(x.Name)).ToList();
    468501
    469         progress.Status = "Obtaining number of runs...";
     502        progress.Status = "Downloading runs...";
    470503        progress.ProgressValue = 0;
    471         p = 0;
     504        p[0] = 0;
    472505        var count = queryClient.GetNumberOfRuns(problemClassFilter);
    473506        if (count == 0) return;
    474507       
     508        var runList = new List<IRun>();
    475509        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        });
    495524
    496525        progress.Status = "Finishing...";
     
    534563          }
    535564        }
    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; }
    537571        try {
    538572          KnowledgeBase.UpdateOfRunsInProgress = true;
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/KnowledgeCenterViewBase.cs

    r13722 r13752  
    5050      RegisterContentProblemEvents();
    5151      RegisterContentProblemInstancesEvents();
     52      RegisterContentProblemCharacteristicsEvents();
    5253      RegisterContentSolutionSeedingPoolEvents();
    5354      RegisterContentSuggestedInstancesEvents();
     
    7071    }
    7172
     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
    7281    private void RegisterContentSolutionSeedingPoolEvents() {
    7382      Content.SolutionSeedingPool.CheckedItemsChanged += ContentOnSolutionSeedingPoolChanged;
     
    92101      DeregisterContentProblemEvents();
    93102      DeregisterContentProblemInstancesEvents();
     103      DeregisterContentProblemCharacteristicsEvents();
    94104      DeregisterContentSolutionSeedingPoolEvents();
    95105      DeregisterContentSuggestedInstancesEvents();
     
    110120      Content.ProblemInstances.CollectionReset -= ContentOnProblemInstancesChanged;
    111121      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;
    112130    }
    113131
     
    136154    protected virtual void OnProblemSolutionsChanged() { }
    137155    protected virtual void OnProblemInstancesChanged() { }
     156    protected virtual void OnProblemCharacteristicsChanged() { }
    138157    protected virtual void OnSolutionSeedingPoolChanged() { }
    139158    protected virtual void OnSuggestedInstancesChanged() { }
     
    175194    }
    176195
     196    private void ContentOnProblemCharacteristicsChanged(object sender, EventArgs e) {
     197      if (InvokeRequired) Invoke((Action)OnProblemCharacteristicsChanged);
     198      else OnProblemCharacteristicsChanged();
     199    }
     200
    177201    private void ContentOnSolutionSeedingPoolChanged(object sender, EventArgs e) {
    178202      if (InvokeRequired) Invoke((Action)OnSolutionSeedingPoolChanged);
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/UnderstandingProblemInstanceView.Designer.cs

    r13751 r13752  
    5252      this.problemInstancesTabControl = new HeuristicLab.MainForm.WindowsForms.DragOverTabControl();
    5353      this.mapTabPage = new System.Windows.Forms.TabPage();
    54       this.instancesTabPage = new System.Windows.Forms.TabPage();
    55       this.problemInstancesView = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    5654      this.mapSplitContainer = new System.Windows.Forms.SplitContainer();
     55      this.showCharacteristicsCheckBox = new System.Windows.Forms.CheckBox();
    5756      this.invPropCheckBox = new System.Windows.Forms.CheckBox();
    5857      this.sizeLabel = new System.Windows.Forms.Label();
     
    6160      this.sizeComboBox = new System.Windows.Forms.ComboBox();
    6261      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();
    6464      this.problemInstancesTabControl.SuspendLayout();
    6565      this.mapTabPage.SuspendLayout();
    66       this.instancesTabPage.SuspendLayout();
    6766      ((System.ComponentModel.ISupportInitialize)(this.mapSplitContainer)).BeginInit();
    6867      this.mapSplitContainer.Panel1.SuspendLayout();
    6968      this.mapSplitContainer.SuspendLayout();
    7069      ((System.ComponentModel.ISupportInitialize)(this.instanceMapChart)).BeginInit();
     70      this.instancesTabPage.SuspendLayout();
    7171      this.SuspendLayout();
    7272      //
     
    9696      this.mapTabPage.UseVisualStyleBackColor = true;
    9797      //
    98       // instancesTabPage
    99       //
    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       // problemInstancesView
    110       //
    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       //
    12398      // mapSplitContainer
    12499      //
     
    138113      this.mapSplitContainer.Panel1.Controls.Add(this.projectionComboBox);
    139114      this.mapSplitContainer.Panel1.Padding = new System.Windows.Forms.Padding(0, 3, 0, 0);
     115      this.mapSplitContainer.Panel2Collapsed = true;
    140116      this.mapSplitContainer.Size = new System.Drawing.Size(986, 728);
    141117      this.mapSplitContainer.SplitterDistance = 847;
    142118      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);
    143131      //
    144132      // invPropCheckBox
     
    153141      this.invPropCheckBox.Text = "inverse proportional";
    154142      this.invPropCheckBox.UseVisualStyleBackColor = true;
     143      this.invPropCheckBox.CheckedChanged += new System.EventHandler(this.InvPropCheckBoxOnCheckedChanged);
    155144      //
    156145      // sizeLabel
     
    203192      this.instanceMapChart.Series.Add(series1);
    204193      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);
    206195      this.instanceMapChart.TabIndex = 12;
    207196      //
     
    214203      this.sizeComboBox.Size = new System.Drawing.Size(273, 21);
    215204      this.sizeComboBox.TabIndex = 13;
     205      this.sizeComboBox.SelectedIndexChanged += new System.EventHandler(this.SizeComboBoxOnSelectedIndexChanged);
    216206      //
    217207      // projectionComboBox
     
    223213      this.projectionComboBox.Size = new System.Drawing.Size(158, 21);
    224214      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;
    236241      //
    237242      // UnderstandingProblemInstanceView
     
    244249      this.problemInstancesTabControl.ResumeLayout(false);
    245250      this.mapTabPage.ResumeLayout(false);
    246       this.instancesTabPage.ResumeLayout(false);
    247251      this.mapSplitContainer.Panel1.ResumeLayout(false);
    248252      this.mapSplitContainer.Panel1.PerformLayout();
     
    250254      this.mapSplitContainer.ResumeLayout(false);
    251255      ((System.ComponentModel.ISupportInitialize)(this.instanceMapChart)).EndInit();
     256      this.instancesTabPage.ResumeLayout(false);
    252257      this.ResumeLayout(false);
    253258
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/UnderstandingProblemInstanceView.cs

    r13751 r13752  
    2020#endregion
    2121
     22using HeuristicLab.Common.Resources;
    2223using HeuristicLab.Core;
     24using HeuristicLab.Core.Views;
     25using HeuristicLab.Data;
    2326using HeuristicLab.MainForm;
    2427using HeuristicLab.OptimizationExpertSystem.Common;
     
    2730using System.Linq;
    2831using System.Text.RegularExpressions;
     32using System.Windows.Forms;
    2933using System.Windows.Forms.DataVisualization.Charting;
    3034
     
    3438  public sealed partial class UnderstandingProblemInstanceView : KnowledgeCenterViewBase {
    3539    private bool SuppressEvents { get; set; }
    36 
     40    private readonly CheckedItemListView<StringValue> characteristicsView;
     41 
    3742    public UnderstandingProblemInstanceView() {
    3843      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);
    3950    }
    4051
     
    4354      if (Content == null) {
    4455        problemInstancesView.Content = null;
     56        characteristicsView.Content = null;
    4557        instanceMapChart.Series["InstancesSeries"].Points.Clear();
    4658        instanceMapChart.Series["CurrentInstanceSeries"].Points.Clear();
    4759      } else {
    4860        problemInstancesView.Content = Content.ProblemInstances;
     61        characteristicsView.Content = Content.ProblemCharacteristics;
    4962        UpdateProjectionComboBox();
    5063        UpdateSizeComboBox();
     
    175188      UpdateProjection();
    176189    }
     190
     191    private void showCharacteristicsCheckBox_CheckedChanged(object sender, EventArgs e) {
     192      mapSplitContainer.Panel2Collapsed = !showCharacteristicsCheckBox.Checked;
     193    }
    177194    #endregion
    178195  }
Note: See TracChangeset for help on using the changeset viewer.