Free cookie consent management tool by TermsFeed Policy Generator

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

#2634: implemented reviewer's comments

Location:
trunk/sources/HeuristicLab.Analysis/3.3/QualityAnalysis
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 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.