Changeset 11388 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking
- Timestamp:
- 09/23/14 17:16:28 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionTracing.cs
r11350 r11388 64 64 65 65 if (fragment == null) { 66 // fragment == null can only mean that the individual is the previous generation elite 67 // which got introduced in the next generation. skip elite, go up the graph to original individual 66 // the fragment can be null for two reasons: 67 // 1) the individual is an elite 68 // 2) the crossover/mutation made no changes to the root parent (or there is a bug in fragment identification) 69 if (index >= parents[0].Data.Length) { 70 throw new InvalidOperationException("Index exceeds tree length."); 71 } 68 72 node = parents[0]; 69 73 continue; … … 92 96 } else if (fragment.Index1 < subtreeIndex) { 93 97 if (subtreeIndex < fragment.Index1 + fragmentLength) { 94 // subtree contained in fragment, index stays the same 98 // in the case of mutation, the fragment could have been introduced via a node replacement 99 // there is no guarantee the subtree exists above this level, therefore the index is set to the fragment index 100 index = fragment.Index1; 95 101 } else { 102 // subtree outside of fragment 96 103 index += node.Data.NodeAt(fragment.Index1).GetLength() - fragmentLength; 97 104 } … … 106 113 107 114 yield return fragmentNode; 108 var up = Trace(node, index, fragmentNode); 115 var up = Trace(node, index, fragmentNode); // force immediate query execution 109 116 foreach (var v in up) { yield return v; } 110 117 break;
Note: See TracChangeset
for help on using the changeset viewer.