Changeset 13307
- Timestamp:
- 11/19/15 17:31:44 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer.cs
r13241 r13307 114 114 bool[] maximization = Maximization.ToArray(); 115 115 116 var nonDominatedIn vididuals = new[] { new { Tree = default(ISymbolicExpressionTree), Qualities = default(double[]) } }.ToList();117 nonDominatedIn vididuals.Clear();116 var nonDominatedIndividuals = new[] { new { Tree = default(ISymbolicExpressionTree), Qualities = default(double[]) } }.ToList(); 117 nonDominatedIndividuals.Clear(); 118 118 119 119 // build list of new non-dominated solutions 120 120 for (int i = 0; i < trees.Length; i++) { 121 if (IsNonDominated(qualities[i], nonDominatedIn vididuals.Select(ind => ind.Qualities), maximization) &&121 if (IsNonDominated(qualities[i], nonDominatedIndividuals.Select(ind => ind.Qualities), maximization) && 122 122 IsNonDominated(qualities[i], trainingBestQualities, maximization)) { 123 for (int j = nonDominatedIn vididuals.Count - 1; j >= 0; j--) {124 if (IsBetterOrEqual(qualities[i], nonDominatedIn vididuals[j].Qualities, maximization)) {125 nonDominatedIn vididuals.RemoveAt(j);123 for (int j = nonDominatedIndividuals.Count - 1; j >= 0; j--) { 124 if (IsBetterOrEqual(qualities[i], nonDominatedIndividuals[j].Qualities, maximization)) { 125 nonDominatedIndividuals.RemoveAt(j); 126 126 } 127 127 } 128 nonDominatedIn vididuals.Add(new { Tree = trees[i], Qualities = qualities[i] });128 nonDominatedIndividuals.Add(new { Tree = trees[i], Qualities = qualities[i] }); 129 129 } 130 130 } 131 131 132 var nonDominatedSolutions = nonDominatedIn vididuals.Select(x => new { Solution = CreateSolution(x.Tree, x.Qualities), Qualities = x.Qualities }).ToList();132 var nonDominatedSolutions = nonDominatedIndividuals.Select(x => new { Solution = CreateSolution(x.Tree, x.Qualities), Qualities = x.Qualities }).ToList(); 133 133 nonDominatedSolutions.ForEach(s => s.Solution.Name = string.Join(",", s.Qualities.Select(q => q.ToString()))); 134 134
Note: See TracChangeset
for help on using the changeset viewer.