Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/23/17 10:42:58 (8 years ago)
Author:
abeham
Message:

#2457: working on identification of problem instances

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

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/ProblemInstanceAnalysis/ProblemInstanceAnalyzer.cs

    r14678 r14691  
    7878      if (currentCharacteristics == null) return base.Apply();
    7979
    80       var order = Enumerable.Range(0, kbCharacteristics.Rows)
     80      var means = kbCharacteristics.GetRow(kbCharacteristics.Rows - 2).ToArray();
     81      var stdevs = kbCharacteristics.GetRow(kbCharacteristics.Rows - 1).ToArray();
     82
     83      for (var i = 0; i < means.Length; i++) {
     84        currentCharacteristics[i] = (currentCharacteristics[i] - means[i]) / stdevs[i];
     85      }
     86
     87      var order = Enumerable.Range(0, kbCharacteristics.Rows - 2)
    8188        .Select(row => new { Row = row, MSE = kbCharacteristics.GetRow(row).Zip(currentCharacteristics, (a, b) => (a - b) * (a - b)).Average() })
    8289        .OrderBy(x => x.MSE);
    8390
    8491      var instances = kbCharacteristics.RowNames.ToList();
    85       while (instances.Count < kbCharacteristics.Rows)
     92      while (instances.Count < kbCharacteristics.Rows - 2)
    8693        instances.Add(instances.Count.ToString(CultureInfo.CurrentCulture.NumberFormat));
    8794
  • branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/ProblemInstanceAnalysis/QAPPRProblemInstanceAnalyzer.cs

    r14678 r14691  
    4949      if (trajectories.Count == 0) return null;
    5050
    51       var characteristics = QAPDirectedWalk.Calculate(trajectories).Select(x => x.Value).ToList();
    52       var result = new DoubleArray(characteristics.Count);
    53       for (var i = 0; i < characteristics.Count; i++) {
    54         var dv = characteristics[i] as DoubleValue;
    55         if (dv != null) result[i] = dv.Value;
    56         else {
    57           var iv = characteristics[i] as IntValue;
    58           if (iv != null) result[i] = iv.Value;
    59         }
    60       }
    61       return result;
     51      return new DoubleArray(PermutationPathAnalysis.GetCharacteristics(trajectories).GetValues().ToArray());
    6252    }
    6353  }
Note: See TracChangeset for help on using the changeset viewer.