Changeset 11318 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking
- Timestamp:
- 08/31/14 18:28:25 (10 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterCrossoverOperator.cs
r11253 r11318 46 46 } 47 47 48 if (fragment == null) 49 throw new InvalidOperationException("Could not identify crossover fragment."); 50 48 51 arcs[0].Data = null; 49 52 arcs[1].Data = fragment; -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionTracing.cs
r11253 r11318 32 32 public static FragmentGraph TraceSubtree(IGenealogyGraphNode<ISymbolicExpressionTree> graphNode, int subtreeIndex) { 33 33 var graph = new FragmentGraph(); 34 var nodes = Trace(graphNode, subtreeIndex); 35 foreach (var n in nodes) { 36 graph.AddVertex(n); 37 } 34 var vertices = Trace(graphNode, subtreeIndex).ToList(); 35 graph.AddVertices(vertices); 38 36 return graph; 39 37 } … … 52 50 while (true) { 53 51 if (!node.Parents.Any()) { 54 var fragmentNode = new FragmentNode(node) { 55 SubtreeIndex = index, 56 }; 52 // no tracing if there are no parents, return a fragment node representing the current trace 53 var fragmentNode = new FragmentNode(node) { SubtreeIndex = index }; 57 54 if (parent != null) { 58 55 var arc = new Arc(parent, fragmentNode); 59 56 parent.AddArc(arc); 60 57 fragmentNode.AddArc(arc); 61 62 // parent.AddForwardArc(arc);63 // fragmentNode.AddReverseArc(arc);64 58 } 65 yield return fragmentNode; // no tracing if there are no parents59 yield return fragmentNode; 66 60 break; 67 61 } 68 62 var parents = node.Parents.ToList(); 69 var fragment = (IFragment<ISymbolicExpressionTreeNode>)node.InArcs.Last().Data; 70 71 if (node.IsElite || fragment == null) { 63 if (node.IsElite) { 72 64 // skip elite, go up the graph to original individual 73 65 node = parents[0]; 74 66 continue; 75 67 } 68 var fragment = (IFragment<ISymbolicExpressionTreeNode>)node.InArcs.Last().Data; 69 70 if (node.Rank > 1 && fragment == null) 71 throw new ArgumentNullException("Fragment cannot be null"); 72 76 73 var fragmentLength = fragment.Root.GetLength(); 77 74 var tree = node.Data; … … 139 136 if (fragment.Index1 > index) { 140 137 if (fragment.Index1 < index + subtreeLength) { 141 // subtree contains fragment => b ifurcationpoint in the fragment graph138 // subtree contains fragment => branching point in the fragment graph 142 139 var fragmentNode = new FragmentNode(node) { 143 140 SubtreeIndex = index,
Note: See TracChangeset
for help on using the changeset viewer.