- Timestamp:
- 01/27/22 11:02:45 (3 years ago)
- Location:
- trunk/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs
r17180 r18211 50 50 void InsertSubtree(int index, ISymbolicExpressionTreeNode tree); 51 51 void RemoveSubtree(int index); 52 void ReplaceSubtree(int index, ISymbolicExpressionTreeNode tree); 53 void ReplaceSubtree(ISymbolicExpressionTreeNode orig, ISymbolicExpressionTreeNode repl); 52 54 53 55 void ResetLocalParameters(IRandom random); -
trunk/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs
r17180 r18211 177 177 ResetCachedValues(); 178 178 } 179 public virtual void ReplaceSubtree(int index, ISymbolicExpressionTreeNode repl) { 180 subtrees[index].Parent = null; 181 subtrees[index] = repl; 182 repl.Parent = this; 183 ResetCachedValues(); 184 } 185 public virtual void ReplaceSubtree(ISymbolicExpressionTreeNode old, ISymbolicExpressionTreeNode repl) { 186 var index = IndexOfSubtree(old); 187 subtrees[index].Parent = null; 188 subtrees[index] = repl; 189 repl.Parent = this; 190 ResetCachedValues(); 191 } 179 192 180 193 public IEnumerable<ISymbolicExpressionTreeNode> IterateNodesBreadth() {
Note: See TracChangeset
for help on using the changeset viewer.