Free cookie consent management tool by TermsFeed Policy Generator

Changeset 15048 for trunk/sources


Ignore:
Timestamp:
06/23/17 15:20:31 (8 years ago)
Author:
abeham
Message:

#2634: implemented reviewer's comments

Location:
trunk/sources
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/IndexedDataTableView.cs

    r14185 r15048  
    158158      series.BorderColor = Color.Empty;
    159159
    160       if (row.VisualProperties.Color != Color.Empty)
    161         series.Color = row.VisualProperties.Color;
    162       else series.Color = Color.Empty;
     160      series.Color = row.VisualProperties.Color;
    163161      series.IsVisibleInLegend = row.VisualProperties.IsVisibleInLegend;
    164162
     
    561559      for (int i = 0; i < row.Values.Count; i++) {
    562560        var value = row.Values[i];
     561        if (IsInvalidValue(value.Item2)) continue;
    563562        var point = new DataPoint();
    564563        point.SetValueXY(value.Item1, value.Item2);
  • trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization/IndexedDataRow.cs

    r14185 r15048  
    3030
    3131namespace HeuristicLab.Analysis {
    32   [Item("IndexedDataRow", "A data row that contains time series.")]
     32  [Item("IndexedDataRow", "A data row that contains a series of points.")]
    3333  [StorableClass]
    3434  public class IndexedDataRow<T> : NamedItem {
     
    105105      OnVisualPropertiesChanged();
    106106    }
     107    protected override void OnNameChanged() {
     108      base.OnNameChanged();
     109      VisualProperties.DisplayName = Name;
     110    }
    107111  }
    108112}
  • trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization/IndexedDataTable.cs

    r14185 r15048  
    107107    public event EventHandler VisualPropertiesChanged;
    108108    protected virtual void OnVisualPropertiesChanged() {
    109       EventHandler handler = VisualPropertiesChanged;
     109      var handler = VisualPropertiesChanged;
    110110      if (handler != null) handler(this, EventArgs.Empty);
    111111    }
     
    115115    }
    116116
    117     protected virtual void RegisterRowsEvents() {
    118       rows.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedDataRow<T>>(rows_ItemsAdded);
    119       rows.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedDataRow<T>>(rows_ItemsRemoved);
    120       rows.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedDataRow<T>>(rows_ItemsReplaced);
    121       rows.CollectionReset += new CollectionItemsChangedEventHandler<IndexedDataRow<T>>(rows_CollectionReset);
    122     }
    123     private void rows_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedDataRow<T>> e) {
     117    private void RegisterRowsEvents() {
     118      rows.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedDataRow<T>>(RowsOnItemsAdded);
     119      rows.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedDataRow<T>>(RowsOnItemsRemoved);
     120      rows.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedDataRow<T>>(RowsOnItemsReplaced);
     121      rows.CollectionReset += new CollectionItemsChangedEventHandler<IndexedDataRow<T>>(RowsOnCollectionReset);
     122      foreach (var row in Rows) RegisterRowEvents(row);
     123    }
     124    protected virtual void RowsOnItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedDataRow<T>> e) {
    124125      foreach (var row in e.Items)
    125126        this.RegisterRowEvents(row);
     
    129130      this.OnReset();
    130131    }
    131     private void rows_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedDataRow<T>> e) {
     132    protected virtual void RowsOnItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedDataRow<T>> e) {
    132133      foreach (var row in e.Items)
    133134        this.DeregisterRowEvents(row);
     
    137138      this.OnReset();
    138139    }
    139     private void rows_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedDataRow<T>> e) {
     140    protected virtual void RowsOnItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedDataRow<T>> e) {
    140141      foreach (var row in e.OldItems)
    141142        this.DeregisterRowEvents(row);
     
    147148      this.OnReset();
    148149    }
    149     private void rows_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedDataRow<T>> e) {
     150    protected virtual void RowsOnCollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedDataRow<T>> e) {
    150151      foreach (var row in e.OldItems)
    151152        this.DeregisterRowEvents(row);
     
    159160    }
    160161
    161     protected virtual void RegisterRowEvents(IndexedDataRow<T> row) {
    162       row.Values.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_ItemsAdded);
    163       row.Values.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_ItemsMoved);
    164       row.Values.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_ItemsRemoved);
    165       row.Values.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_ItemsReplaced);
    166       row.Values.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_CollectionReset);
    167     }
    168     protected virtual void DeregisterRowEvents(IndexedDataRow<T> row) {
    169       row.Values.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_ItemsAdded);
    170       row.Values.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_ItemsMoved);
    171       row.Values.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_ItemsRemoved);
    172       row.Values.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_ItemsReplaced);
    173       row.Values.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_CollectionReset);
    174     }
    175 
    176     private void Values_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
    177       this.OnReset();
    178     }
    179     private void Values_ItemsMoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
    180       this.OnReset();
    181     }
    182     private void Values_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
    183       this.OnReset();
    184     }
    185     private void Values_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
    186       this.OnReset();
    187     }
    188     private void Values_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
     162    private void RegisterRowEvents(IndexedDataRow<T> row) {
     163      row.Values.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnItemsAdded);
     164      row.Values.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnItemsMoved);
     165      row.Values.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnItemsRemoved);
     166      row.Values.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnItemsReplaced);
     167      row.Values.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnCollectionReset);
     168    }
     169    private void DeregisterRowEvents(IndexedDataRow<T> row) {
     170      row.Values.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnItemsAdded);
     171      row.Values.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnItemsMoved);
     172      row.Values.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnItemsRemoved);
     173      row.Values.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnItemsReplaced);
     174      row.Values.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnCollectionReset);
     175    }
     176
     177    protected virtual void ValuesOnItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
     178      this.OnReset();
     179    }
     180    protected virtual void ValuesOnItemsMoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
     181      this.OnReset();
     182    }
     183    protected virtual void ValuesOnItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
     184      this.OnReset();
     185    }
     186    protected virtual void ValuesOnItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
     187      this.OnReset();
     188    }
     189    protected virtual void ValuesOnCollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
    189190      this.OnReset();
    190191    }
  • trunk/sources/HeuristicLab.Analysis/3.3/QualityAnalysis/ExpectedRuntimeHelper.cs

    r14775 r15048  
    4646
    4747  public struct ErtCalculationResult {
    48     public int SuccessfulRuns;
    49     public int TotalRuns;
    50     public double ExpectedRuntime;
     48    public readonly int SuccessfulRuns;
     49    public readonly int TotalRuns;
     50    public readonly double ExpectedRuntime;
    5151
    5252    public ErtCalculationResult(int successful, int total, double ert) {
     
    5757
    5858    public override string ToString() {
    59       return SuccessfulRuns == 0 ? "\u221e" // infinity symbol
    60                                  : ExpectedRuntime.ToString("##,0.0", CultureInfo.CurrentCulture.NumberFormat);
     59      return ExpectedRuntime.ToString("##,0.0", CultureInfo.CurrentCulture.NumberFormat);
    6160    }
    6261  }
  • trunk/sources/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityPerClockAnalyzer.cs

    r14102 r15048  
    9191
    9292      if (values.Count == 0) {
    93         values.Add(newEntry);
    94         values.Add(Tuple.Create(runtimeSoFar, bestQuality)); // duplicate entry that will be replaced
     93        values.Add(newEntry); // record the first data
     94        values.Add(Tuple.Create(runtimeSoFar, bestQuality)); // last entry records max number of evaluations
    9595        return base.Apply();
    9696      }
     
    9898      var improvement = values.Last().Item2 != bestQuality;
    9999      if (improvement) {
    100         values[values.Count - 1] = newEntry;
    101         values.Add(Tuple.Create(runtimeSoFar, bestQuality)); // duplicate entry that will be replaced
     100        values[values.Count - 1] = newEntry; // record the improvement
     101        values.Add(Tuple.Create(runtimeSoFar, bestQuality)); // last entry records max number of evaluations
    102102      } else {
    103103        values[values.Count - 1] = Tuple.Create(runtimeSoFar, bestQuality);
  • trunk/sources/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityPerEvaluationsAnalyzer.cs

    r14102 r15048  
    8888      if (evalMoves != null) evaluations += evalMoves.Value * MoveCostPerSolutionParameter.ActualValue.Value;
    8989
    90       var dataTable = QualityPerEvaluationsParameter.ActualValue;
    91       var values = dataTable.Rows["First-hit Graph"].Values;
    92       if (evaluations == 0 || values.Count > 0 && evaluations < values.Last().Item1) evaluations = 1;
    93       var newEntry = Tuple.Create(evaluations, bestQuality);
     90      if (evaluations > 0) {
     91        var dataTable = QualityPerEvaluationsParameter.ActualValue;
     92        var values = dataTable.Rows["First-hit Graph"].Values;
    9493
    95       if (values.Count == 0) {
    96         values.Add(newEntry);
    97         values.Add(Tuple.Create(evaluations, bestQuality)); // duplicate entry that will be replaced
    98         return base.Apply();
    99       }
     94        var newEntry = Tuple.Create(evaluations, bestQuality);
    10095
    101       var improvement = values.Last().Item2 != bestQuality;
    102       if (improvement) {
    103         values[values.Count - 1] = newEntry;
    104         values.Add(Tuple.Create(evaluations, bestQuality)); // duplicate entry that will be replaced
    105       } else {
    106         values[values.Count - 1] = Tuple.Create(evaluations, bestQuality);
     96        if (values.Count == 0) {
     97          values.Add(newEntry); // record the first data
     98          values.Add(Tuple.Create(evaluations, bestQuality)); // last entry records max number of evaluations
     99          return base.Apply();
     100        }
     101
     102        var improvement = values.Last().Item2 != bestQuality;
     103        if (improvement) {
     104          values[values.Count - 1] = newEntry; // record the improvement
     105          values.Add(Tuple.Create(evaluations, bestQuality)); // last entry records max number of evaluations
     106        } else {
     107          values[values.Count - 1] = Tuple.Create(evaluations, bestQuality); // the last entry is updated
     108        }
    107109      }
    108110      return base.Apply();
Note: See TracChangeset for help on using the changeset viewer.