Changeset 15109 for stable/HeuristicLab.Optimization/3.3/MultiObjective
- Timestamp:
- 07/03/17 09:40:13 (7 years ago)
- Location:
- stable
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 15051,15080,15086-15087
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Optimization merged: 15051,15080,15086
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization/3.3/MultiObjective/DominationCalculator.cs
r15080 r15109 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Core;25 using HeuristicLab.Data;26 24 27 25 namespace HeuristicLab.Optimization { … … 100 98 } 101 99 102 private static List<Tuple<T, double[]>> CalculateBestFront(T[] individuals, double[][] qualities, bool[] maximization, bool dominateOnEqualQualities, int populationSize, out Dictionary<T, List<int>> dominatedIndividuals, out int[] dominationCounter, out int[] rank) {100 private static List<Tuple<T, double[]>> CalculateBestFront(T[] solutions, double[][] qualities, bool[] maximization, bool dominateOnEqualQualities, int populationSize, out Dictionary<T, List<int>> dominatedIndividuals, out int[] dominationCounter, out int[] rank) { 103 101 var front = new List<Tuple<T, double[]>>(); 104 102 dominatedIndividuals = new Dictionary<T, List<int>>(); … … 106 104 rank = new int[populationSize]; 107 105 for (int pI = 0; pI < populationSize - 1; pI++) { 108 var p = individuals[pI];106 var p = solutions[pI]; 109 107 List<int> dominatedIndividualsByp; 110 108 if (!dominatedIndividuals.TryGetValue(p, out dominatedIndividualsByp)) … … 117 115 } else if (test == DominationResult.IsDominated) { 118 116 dominationCounter[pI] += 1; 119 if (!dominatedIndividuals.ContainsKey( individuals[qI]))120 dominatedIndividuals.Add( individuals[qI], new List<int>());121 dominatedIndividuals[ individuals[qI]].Add(pI);117 if (!dominatedIndividuals.ContainsKey(solutions[qI])) 118 dominatedIndividuals.Add(solutions[qI], new List<int>()); 119 dominatedIndividuals[solutions[qI]].Add(pI); 122 120 } 123 121 if (pI == populationSize - 2 … … 125 123 && dominationCounter[qI] == 0) { 126 124 rank[qI] = 0; 127 front.Add(Tuple.Create( individuals[qI], qualities[qI]));125 front.Add(Tuple.Create(solutions[qI], qualities[qI])); 128 126 } 129 127 }
Note: See TracChangeset
for help on using the changeset viewer.