Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/13/16 16:25:12 (9 years ago)
Author:
abeham
Message:

#2547:

  • worked on problem instance mapping
  • started working on improved suggestion algorithm
File:
1 edited

Legend:

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

    r12956 r13757  
    1 using System.Collections.Generic;
     1using HeuristicLab.Optimization;
     2using System;
     3using System.Collections.Generic;
    24using System.Globalization;
    35using System.Linq;
    4 using HeuristicLab.Optimization;
    56
    67namespace HeuristicLab.Analysis {
    78  public static class ExpectedRuntimeHelper {
    8     public static ErtCalculationResult CalculateErt(List<IRun> runs, string indexedDataTableName, double target, bool maximization) {
     9    public static ErtCalculationResult CalculateErt(IEnumerable<IEnumerable<Tuple<double, double>>> convGraphs, double target, bool maximization) {
    910      var successful = new List<double>();
    1011      var unsuccessful = new List<double>();
    11       foreach (var r in runs) {
     12      foreach (var graph in convGraphs) {
    1213        var targetAchieved = false;
    13         var row = ((IndexedDataTable<double>)r.Results[indexedDataTableName]).Rows.First();
    14         foreach (var v in row.Values) {
     14        var lastEffort = double.MaxValue;
     15        foreach (var v in graph) {
    1516          if (maximization && v.Item2 >= target || !maximization && v.Item2 <= target) {
    1617            successful.Add(v.Item1);
     
    1819            break;
    1920          }
     21          lastEffort = v.Item1;
    2022        }
    21         if (!targetAchieved) unsuccessful.Add(row.Values.Last().Item1);
     23        if (!targetAchieved) unsuccessful.Add(lastEffort);
    2224      }
    2325
     
    3234      }
    3335      return new ErtCalculationResult(successful.Count, (successful.Count + unsuccessful.Count), ert);
     36    }
     37
     38    public static ErtCalculationResult CalculateErt(List<IRun> runs, string indexedDataTableName, double target, bool maximization) {
     39      return CalculateErt(runs.Select(r => ((IndexedDataTable<double>)r.Results[indexedDataTableName]).Rows.First().Values), target, maximization);
    3440    }
    3541  }
Note: See TracChangeset for help on using the changeset viewer.