Changeset 7494 for branches/HeuristicLab.Crossovers/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionCrossover.cs
- Timestamp:
- 02/21/12 10:57:40 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Crossovers/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionCrossover.cs
r7481 r7494 149 149 return rows.Where(i => i < testPartitionStart || testPartitionEnd <= i); 150 150 } 151 152 protected static void Swap(CutPoint crossoverPoint, ISymbolicExpressionTreeNode selectedBranch) { 153 if (crossoverPoint.Child != null) { 154 // manipulate the tree of parent0 in place 155 // replace the branch in tree0 with the selected branch from tree1 156 crossoverPoint.Parent.RemoveSubtree(crossoverPoint.ChildIndex); 157 if (selectedBranch != null) { 158 crossoverPoint.Parent.InsertSubtree(crossoverPoint.ChildIndex, selectedBranch); 159 } 160 } else { 161 // child is null (additional child should be added under the parent) 162 if (selectedBranch != null) { 163 crossoverPoint.Parent.AddSubtree(selectedBranch); 164 } 165 } 166 } 151 167 } 152 168 }
Note: See TracChangeset
for help on using the changeset viewer.