Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/16/15 17:04:35 (9 years ago)
Author:
abeham
Message:

#2457, #2431: updated from trunk, worked on okb connection for downloading knowledge base

Location:
branches/PerformanceComparison
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison

    • Property svn:ignore
      •  

        old new  
        22*.suo
        33*.user
         4.git
         5.gitignore
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views

  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs

    r12813 r13475  
    248248        matrix[5, i] = seriesValues.StandardDeviation();
    249249        matrix[6, i] = seriesValues.Variance();
    250         matrix[7, i] = seriesValues.Percentile(0.25);
    251         matrix[8, i] = seriesValues.Percentile(0.75);
     250        matrix[7, i] = seriesValues.Quantile(0.25);
     251        matrix[8, i] = seriesValues.Quantile(0.75);
    252252      }
    253253      statisticsMatrixView.Content = matrix;
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionChartAggregationView.cs

    r12692 r13475  
    8080        return;
    8181      }
     82      UpdateDataTableComboBox(); // will trigger AddRuns
     83    }
     84    private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) {
     85      if (suppressUpdates) return;
     86      if (InvokeRequired) {
     87        Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved), sender, e);
     88        return;
     89      }
     90      RemoveRuns(e.Items);
    8291      UpdateDataTableComboBox();
    8392      UpdateDataRowComboBox();
    84       AddRuns(e.Items);
    85     }
    86     private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) {
    87       if (suppressUpdates) return;
    88       if (InvokeRequired) {
    89         Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved), sender, e);
    90         return;
    91       }
     93      RebuildCombinedDataTable();
     94    }
     95    private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) {
     96      if (suppressUpdates) return;
     97      if (InvokeRequired) {
     98        Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset), sender, e);
     99        return;
     100      }
     101      RemoveRuns(e.OldItems);
    92102      UpdateDataTableComboBox();
    93103      UpdateDataRowComboBox();
    94       RemoveRuns(e.Items);
    95     }
    96     private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) {
    97       if (suppressUpdates) return;
    98       if (InvokeRequired) {
    99         Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset), sender, e);
    100         return;
    101       }
    102       UpdateDataTableComboBox();
    103       UpdateDataRowComboBox();
    104       RemoveRuns(e.OldItems);
    105       AddRuns(e.Items);
     104      RebuildCombinedDataTable();
    106105    }
    107106    private void Content_AlgorithmNameChanged(object sender, EventArgs e) {
     
    117116      suppressUpdates = Content.UpdateOfRunsInProgress;
    118117      if (!suppressUpdates) {
     118        foreach (var run in runMapping)
     119          DeregisterRunEvents(run.Key);
     120        runMapping.Clear();
     121        combinedDataTable.Rows.Clear();
    119122        UpdateDataTableComboBox();
    120         UpdateDataRowComboBox();
    121         UpdateRuns(Content);
    122123      }
    123124    }
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionRLDView.cs

    r12956 r13475  
    463463      ertTableView.DataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
    464464    }
    465 
    466 
    467465    #endregion
    468466
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionTableView.cs

    r12692 r13475  
    2525using System.Linq;
    2626using System.Windows.Forms;
     27using HeuristicLab.Collections;
    2728using HeuristicLab.Core;
    2829using HeuristicLab.Data.Views;
     
    122123
    123124    protected override void UpdateColumnHeaders() {
    124       HashSet<string> visibleColumnNames = new HashSet<string>(dataGridView.Columns.OfType<DataGridViewColumn>()
    125        .Where(c => c.Visible && !string.IsNullOrEmpty(c.HeaderText)).Select(c => c.HeaderText));
    126 
     125      string[] colNames = base.Content.ColumnNames.ToArray();
     126      int colCount = colNames.Length;
    127127      for (int i = 0; i < dataGridView.ColumnCount; i++) {
    128         if (i < base.Content.ColumnNames.Count())
    129           dataGridView.Columns[i].HeaderText = base.Content.ColumnNames.ElementAt(i);
     128        if (i < colCount)
     129          dataGridView.Columns[i].HeaderText = colNames[i];
    130130        else
    131131          dataGridView.Columns[i].HeaderText = "Column " + (i + 1);
     132      }
     133
     134      HashSet<string> visibleColumnNames = new HashSet<string>(
     135        dataGridView.Columns.OfType<DataGridViewColumn>()
     136       .Where(c => c.Visible)
     137       .Where(c => !string.IsNullOrEmpty(c.HeaderText))
     138       .Where(c => !IsConstant(c.HeaderText))
     139       .Select(c => c.HeaderText));
     140
     141      for (int i = 0; i < dataGridView.ColumnCount; i++) {
    132142        dataGridView.Columns[i].Visible = visibleColumnNames.Count == 0 || visibleColumnNames.Contains(dataGridView.Columns[i].HeaderText);
    133143      }
     144    }
     145
     146    // returns true when all values in the column are the same (missing values are included in the count)
     147    private bool IsConstant(string columnName) {
     148      Func<IRun, string, string> GetStringValue = (IRun r, string colName) => {
     149        // also include missing values in the count
     150        IItem v = null;
     151        if (r.Parameters.TryGetValue(colName, out v)) return v.ToString();
     152        if (r.Results.TryGetValue(colName, out v)) return v.ToString();
     153        return string.Empty;
     154      };
     155
     156      var firstRun = Content.First();
     157      string firstValue = GetStringValue(firstRun, columnName);
     158      return Content.Skip(1).All(run => firstValue == GetStringValue(run, columnName));
    134159    }
    135160
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs

    r12692 r13475  
    389389        return;
    390390      ReadOnly = true;
     391
    391392      try {
     393        RunCollection.UpdateOfRunsInProgress = true;
    392394        RunCollection.Modify();
    393395      } finally {
    394396        ReadOnly = false;
     397        RunCollection.UpdateOfRunsInProgress = false;
    395398      }
    396399    }
Note: See TracChangeset for help on using the changeset viewer.