Changeset 11997 for branches/ALPS
- Timestamp:
- 02/13/15 11:59:57 (10 years ago)
- Location:
- branches/ALPS/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Files:
-
- 1 added
- 1 deleted
- 2 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/ALPS/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r11975 r11997 118 118 </ItemGroup> 119 119 <ItemGroup> 120 <Compile Include="Analyzers\SymbolicDataAnalysisBottomUpDiversityAnalyzer.cs" /> 121 <Compile Include="Analyzers\SymbolicDataAnalysisPhenotypicDiversityAnalyzer.cs" /> 120 122 <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectivePruningAnalyzer.cs" /> 121 123 <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer.cs" /> … … 240 242 <Compile Include="TreeMatching\SymbolicExpressionTreeNodeComparer.cs" /> 241 243 <Compile Include="TreeMatching\SymbolicExpressionTreeNodeEqualityComparer.cs" /> 244 <Compile Include="TreeMatching\SymbolicExpressionTreePhenotypicSimilarityCalculator.cs" /> 242 245 <None Include="HeuristicLab.snk" /> 243 246 <None Include="Plugin.cs.frame" /> -
branches/ALPS/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeBottomUpSimilarityCalculator.cs
r11950 r11997 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 81 81 82 82 // visit nodes in order of decreasing height to ensure correct mapping 83 var nodes1 = n1.IterateNodesPrefix(). ToList();83 var nodes1 = n1.IterateNodesPrefix().OrderByDescending(x => x.GetDepth()).ToList(); 84 84 var nodes2 = n2.IterateNodesPrefix().ToList(); 85 85 for (int i = 0; i < nodes1.Count; ++i) { … … 98 98 if (w == null) continue; 99 99 100 // at this point we know that v and w are isomorphic, however, the mapping cannot be done directly (as in the paper) because the trees are unordered (subtree order might differ) 101 // the solution is to sort subtrees by label using IterateBreadthOrdered (this will work because the subtrees are isomorphic!) and simultaneously iterate over the two subtrees 100 // at this point we know that v and w are isomorphic, however, the mapping cannot be done directly 101 // (as in the paper) because the trees are unordered (subtree order might differ). the solution is 102 // to sort subtrees from under commutative labels (this will work because the subtrees are isomorphic!) 103 // while iterating over the two subtrees 102 104 var vv = IterateBreadthOrdered(v, comparer).ToList(); 103 105 var ww = IterateBreadthOrdered(w, comparer).ToList(); … … 133 135 foreach (var n in nodes) { 134 136 if (n.SubtreeCount == 0) { 135 var label = Label(n);137 var label = GetLabel(n); 136 138 if (!labelMap.ContainsKey(label)) { 137 139 var z = new GraphNode { SymbolicExpressionTreeNode = n, Label = label }; … … 209 211 } 210 212 211 private st ringLabel(ISymbolicExpressionTreeNode node) {213 private static string GetLabel(ISymbolicExpressionTreeNode node) { 212 214 if (node.SubtreeCount > 0) 213 215 return node.Symbol.Name; -
branches/ALPS/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreePhenotypicSimilarityCalculator.cs
r11975 r11997 30 30 [Item("PhenotypicSimilarityCalculator", "An operator that calculates the similarity betweeon two trees based on the correlation of their outputs.")] 31 31 [StorableClass] 32 public class PhenotypicSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator , ISymbolicDataAnalysisExpressionSimilarityCalculator{32 public class PhenotypicSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator { 33 33 public IDataAnalysisProblemData ProblemData { get; set; } 34 34 public ISymbolicDataAnalysisExpressionTreeInterpreter Interpreter { get; set; }
Note: See TracChangeset
for help on using the changeset viewer.