Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/24/17 09:51:10 (7 years ago)
Author:
abeham
Message:

#2457: merged trunk into branch

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

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/HeuristicLab.Analysis

  • branches/PerformanceComparison/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityPerEvaluationsAnalyzer.cs

    r14058 r15282  
    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.