Changeset 14691 for branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/ProblemInstanceAnalysis
- Timestamp:
- 02/23/17 10:42:58 (8 years ago)
- 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 78 78 if (currentCharacteristics == null) return base.Apply(); 79 79 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) 81 88 .Select(row => new { Row = row, MSE = kbCharacteristics.GetRow(row).Zip(currentCharacteristics, (a, b) => (a - b) * (a - b)).Average() }) 82 89 .OrderBy(x => x.MSE); 83 90 84 91 var instances = kbCharacteristics.RowNames.ToList(); 85 while (instances.Count < kbCharacteristics.Rows )92 while (instances.Count < kbCharacteristics.Rows - 2) 86 93 instances.Add(instances.Count.ToString(CultureInfo.CurrentCulture.NumberFormat)); 87 94 -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/ProblemInstanceAnalysis/QAPPRProblemInstanceAnalyzer.cs
r14678 r14691 49 49 if (trajectories.Count == 0) return null; 50 50 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()); 62 52 } 63 53 }
Note: See TracChangeset
for help on using the changeset viewer.