Changeset 10837 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking
- Timestamp:
- 05/11/14 18:29:47 (11 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterManipulatorOperator.cs
r10833 r10837 48 48 var a = nodesAfter[i]; 49 49 var b = nodesBefore[i]; 50 if (ReferenceEquals(a, b) && comparer.Equals(a, b)) continue; 50 51 bool found = false; 52 if (comparer.Equals(a, b)) { 53 int m = 0; 54 for (int j = 0; j < a.SubtreeCount; ++j) { 55 if (!AreSimilar(a.GetSubtree(j), b.GetSubtree(j), comparer)) { ++m; } 56 if (m > 1) { 57 found = true; 58 break; 59 } 60 } 61 if (m == 0) { 62 // everything is similar so we skip the whole subtree 63 i += a.GetLength(); 64 } 65 if (!found) continue; 66 } 51 67 fragment = new Fragment<ISymbolicExpressionTreeNode> { 52 68 Root = a, … … 60 76 return base.Apply(); 61 77 } 78 79 private bool AreSimilar(ISymbolicExpressionTreeNode a, ISymbolicExpressionTreeNode b, SymbolicExpressionTreeNodeSimilarityComparer comp) { 80 int length = a.GetLength(); 81 return comparer.Equals(a, b) && length.Equals(b.GetLength()) && SymbolicExpressionTreeMatching.Match(a, b, comp) == length; 82 } 62 83 } 63 84 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeManipulatorOperator.cs
r10833 r10837 31 31 32 32 var vChild = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph[ChildParameter.ActualValue]; 33 vChild.InArcs.First().Data = vChild.Content.IterateNodesPrefix().ToList(); 33 var vClone = (IGenealogyGraphNode<ISymbolicExpressionTree>)vChild.InArcs.Last().Source; 34 vChild.InArcs.First().Data = vClone.Content.IterateNodesPrefix().ToList(); 34 35 35 var vClone = (IGenealogyGraphNode<ISymbolicExpressionTree>)vChild.InArcs.Last().Source;36 36 var fragment = (IFragment<ISymbolicExpressionTreeNode>)vClone.InArcs.Last().Data; 37 37 if (fragment != null) { -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionTracing.cs
r10833 r10837 36 36 var arc = new GenealogyGraphArc { Source = parent, Target = fragmentNode }; 37 37 parent.AddForwardArc(arc); 38 // fragmentNode.Content.Index1 = parent.Content.Index1;39 38 } 40 39 yield return fragmentNode; // no tracing if there are no parents … … 62 61 var fragmentNode = new FragmentNode { 63 62 Content = new Fragment<ISymbolicExpressionTreeNode> { Root = subtree }, 64 Rank = node.Rank 63 Rank = node.Rank, 64 Quality = node.Quality 65 65 }; 66 66 if (parent != null) {
Note: See TracChangeset
for help on using the changeset viewer.