Changeset 6684
- Timestamp:
- 08/30/11 17:48:18 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs
r6375 r6684 55 55 : base() { 56 56 symbol = original.symbol; // symbols are reused 57 subtrees = new List<ISymbolicExpressionTreeNode>(original.subtrees.Count); 58 foreach (var subtree in original.subtrees) { 59 var clonedSubtree = cloner.Clone(subtree); 60 subtrees.Add(clonedSubtree); 61 clonedSubtree.Parent = this; 57 if (original.subtrees != null) { 58 subtrees = new List<ISymbolicExpressionTreeNode>(original.subtrees.Count); 59 foreach (var subtree in original.subtrees) { 60 var clonedSubtree = cloner.Clone(subtree); 61 subtrees.Add(clonedSubtree); 62 clonedSubtree.Parent = this; 63 } 62 64 } 63 65 } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeTerminalNode.cs
r6233 r6684 37 37 [StorableConstructor] 38 38 protected SymbolicExpressionTreeTerminalNode(bool deserializing) : base(deserializing) { } 39 // don't call cloning constructor of base to prevent allocation of sub-trees list in base! 40 protected SymbolicExpressionTreeTerminalNode(SymbolicExpressionTreeTerminalNode original, Cloner cloner) 41 : base() { 42 // symbols are reused 43 this.Symbol = original.Symbol; 44 } 39 protected SymbolicExpressionTreeTerminalNode(SymbolicExpressionTreeTerminalNode original, Cloner cloner) : base(original, cloner) { } 45 40 protected SymbolicExpressionTreeTerminalNode() : base() { } 46 41
Note: See TracChangeset
for help on using the changeset viewer.