Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/03/15 23:33:19 (9 years ago)
Author:
abeham
Message:

#2431: Changed analyzer to always output last value (even if quality is equal)

Location:
branches/PerformanceComparison/HeuristicLab.Analysis/3.3/QualityAnalysis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityPerClockAnalyzer.cs

    r12808 r12834  
    7979      var values = dataTable.Rows["First-hit Graph"].Values;
    8080
    81       if (values.Count == 0 || values.Last().Item2 != bestQuality) {
    82         var lastUpdateTime = LastUpdateTimeParameter.ActualValue;
    83         if (lastUpdateTime == null) {
    84           lastUpdateTime = new DateTimeValue(DateTime.UtcNow.AddMilliseconds(-1));
    85           LastUpdateTimeParameter.ActualValue = lastUpdateTime;
    86         }
     81      var lastUpdateTime = LastUpdateTimeParameter.ActualValue;
     82      if (lastUpdateTime == null) {
     83        lastUpdateTime = new DateTimeValue(DateTime.UtcNow.AddMilliseconds(-1));
     84        LastUpdateTimeParameter.ActualValue = lastUpdateTime;
     85      }
    8786
    88         var now = DateTime.UtcNow;
    89         var runtimeSoFar = (now - lastUpdateTime.Value).TotalSeconds + (values.Count > 0 ? values.Last().Item1 : 0);
    90         dataTable.Rows["First-hit Graph"].Values.Add(Tuple.Create(runtimeSoFar, bestQuality));
    91         lastUpdateTime.Value = now;
     87      var now = DateTime.UtcNow;
     88      var runtimeSoFar = (now - lastUpdateTime.Value).TotalSeconds + (values.Count > 0 ? values.Last().Item1 : 0);
     89      lastUpdateTime.Value = now;
     90      var newEntry = Tuple.Create(runtimeSoFar, bestQuality);
     91
     92      if (values.Count == 0) {
     93        values.Add(newEntry);
     94        values.Add(Tuple.Create(runtimeSoFar, bestQuality)); // duplicate entry that will be replaced
     95        return base.Apply();
     96      }
     97
     98      var improvement = values.Last().Item2 != bestQuality;
     99      if (improvement) {
     100        values[values.Count - 1] = newEntry;
     101        values.Add(Tuple.Create(runtimeSoFar, bestQuality)); // duplicate entry that will be replaced
     102      } else {
     103        values[values.Count - 1] = Tuple.Create(runtimeSoFar, bestQuality);
    92104      }
    93105      return base.Apply();
  • branches/PerformanceComparison/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityPerEvaluationsAnalyzer.cs

    r12808 r12834  
    9191      var values = dataTable.Rows["First-hit Graph"].Values;
    9292      if (evaluations == 0 || values.Count > 0 && evaluations < values.Last().Item1) evaluations = 1;
    93       if (values.Count == 0 || values.Last().Item2 != bestQuality)
    94         values.Add(Tuple.Create((double)evaluations, bestQuality));
     93      var newEntry = Tuple.Create(evaluations, bestQuality);
    9594
     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      }
     100
     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);
     107      }
    96108      return base.Apply();
    97109    }
Note: See TracChangeset for help on using the changeset viewer.