- Timestamp:
- 07/15/16 10:31:06 (8 years ago)
- Location:
- branches/HeuristicLab.Problems.MultiObjectiveTestFunctions
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Analyzers/HypervolumeAnalyzer.cs
r14044 r14081 91 91 92 92 93 IEnumerable<double[]> front = NonDominatedSelect. selectNonDominatedVectors(qualities.Select(q => q.ToArray()), testFunction.Maximization(objectives), true);93 IEnumerable<double[]> front = NonDominatedSelect.SelectNonDominatedVectors(qualities.Select(q => q.ToArray()), testFunction.Maximization(objectives), true); 94 94 95 95 double hv = front.Any() ? Hypervolume.Calculate(front, testFunction.ReferencePoint(objectives), testFunction.Maximization(objectives)) : 0; -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Analyzers/NormalizedHypervolumeAnalyzer.cs
r14044 r14081 82 82 } 83 83 84 IEnumerable<double[]> front = NonDominatedSelect. selectNonDominatedVectors(qualities.Select(q => q.ToArray()), testFunction.Maximization(objectives), true);84 IEnumerable<double[]> front = NonDominatedSelect.SelectNonDominatedVectors(qualities.Select(q => q.ToArray()), testFunction.Maximization(objectives), true); 85 85 86 86 if (!results.ContainsKey(resultsHV)) results.Add(new Result(resultsHV, typeof(DoubleValue))); -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Calculators/HyperVolume.cs
r14030 r14081 53 53 /// 54 54 public static double Calculate(IEnumerable<double[]> front, double[] referencePoint, bool[] maximization) { 55 front = NonDominatedSelect. removeNonReferenceDominatingVectors(front, referencePoint, maximization, false);55 front = NonDominatedSelect.GetDominatingVectors(front, referencePoint, maximization, false); 56 56 if (maximization.Length == 2) 57 57 return Calculate2D(front, referencePoint, maximization); -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/NonDominatedSelect.cs
r14030 r14081 21 21 22 22 using System.Collections.Generic; 23 using System.Linq;24 23 25 24 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { … … 28 27 public enum DominationResult { Dominates, IsDominated, IsNonDominated }; 29 28 30 public static IEnumerable<double[]> selectNonDominatedVectors(IEnumerable<double[]> qualities, bool[] maximization, bool dominateOnEqualQualities) { 31 int populationSize = qualities.Count(); 29 public static IEnumerable<double[]> SelectNonDominatedVectors(IEnumerable<double[]> qualities, bool[] maximization, bool dominateOnEqualQualities) { 32 30 33 31 List<double[]> front = new List<double[]>(); … … 38 36 if (res == DominationResult.Dominates) { insert = false; break; } //Vector domiates Row 39 37 else if (res == DominationResult.IsDominated) { //Row dominates Vector 40 front.Remove Range(i, 1);38 front.RemoveAt(i); 41 39 } 42 40 } … … 49 47 } 50 48 51 public static IEnumerable<double[]> removeNonReferenceDominatingVectors(IEnumerable<double[]> qualities, double[] reference, bool[] maximization, bool dominateOnEqualQualities) {49 public static IEnumerable<double[]> GetDominatingVectors(IEnumerable<double[]> qualities, double[] reference, bool[] maximization, bool dominateOnEqualQualities) { 52 50 List<double[]> front = new List<double[]>(); 53 51 foreach (double[] vec in qualities) { -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/MultiObjectiveTestfunctionTests/CrowdingTest.cs
r14030 r14081 103 103 point3[1] = 2; 104 104 double[][] front = { point, point1, point2, point3 }; 105 double dist = Crowding.Calculate(front, new double[,] { { 0, 2 }, { 0, 1 } }); ;105 double dist = Crowding.Calculate(front, new double[,] { { 0, 2 }, { 0, 1 } }); 106 106 Assert.AreEqual(4.5, dist); 107 107 } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/MultiObjectiveTestfunctionTests/FastHyperVolumeTests.cs
r14030 r14081 125 125 points.Add(p); 126 126 } 127 var front = NonDominatedSelect. selectNonDominatedVectors(points, maximization, true);127 var front = NonDominatedSelect.SelectNonDominatedVectors(points, maximization, true); 128 128 129 129 double dim3hv = Hypervolume.Calculate(front, referencePoint, new bool[3]); -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/MultiObjectiveTestfunctionTests/HyperVolumeTests.cs
r13988 r14081 179 179 referencePoint[0] = 0; 180 180 referencePoint[1] = 1; 181 double nw = Hypervolume.Calculate(NonDominatedSelect. selectNonDominatedVectors(front, maximization, true), referencePoint, maximization);181 double nw = Hypervolume.Calculate(NonDominatedSelect.SelectNonDominatedVectors(front, maximization, true), referencePoint, maximization); 182 182 Assert.AreEqual(1, nw); 183 183 … … 193 193 referencePoint[0] = 1; 194 194 referencePoint[1] = 0; 195 double se = Hypervolume.Calculate(NonDominatedSelect. selectNonDominatedVectors(front, maximization, true), referencePoint, maximization);195 double se = Hypervolume.Calculate(NonDominatedSelect.SelectNonDominatedVectors(front, maximization, true), referencePoint, maximization); 196 196 Assert.AreEqual(1, se); 197 197
Note: See TracChangeset
for help on using the changeset viewer.