Changeset 5733 for branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentDuplicater.cs
- Timestamp:
- 03/17/11 14:07:47 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentDuplicater.cs
r5686 r5733 86 86 var invocationNodes = (from node in symbolicExpressionTree.IterateNodesPrefix().OfType<InvokeFunctionTreeNode>() 87 87 where node.Symbol.FunctionName == selectedDefunBranch.FunctionName 88 where node.Sub Trees.Count() == selectedDefunBranch.NumberOfArguments88 where node.Subtrees.Count() == selectedDefunBranch.NumberOfArguments 89 89 select node).ToList(); 90 90 // do this repeatedly until no matching invocations are found … … 93 93 foreach (var invokeNode in invocationNodes) { 94 94 // check that the invocation node really has the correct number of arguments 95 if (invokeNode.Sub Trees.Count() != selectedDefunBranch.NumberOfArguments) throw new InvalidOperationException();96 var argumentBranch = invokeNode.GetSub Tree(selectedArgumentSymbol.ArgumentIndex);95 if (invokeNode.Subtrees.Count() != selectedDefunBranch.NumberOfArguments) throw new InvalidOperationException(); 96 var argumentBranch = invokeNode.GetSubtree(selectedArgumentSymbol.ArgumentIndex); 97 97 var clonedArgumentBranch = (ISymbolicExpressionTreeNode)argumentBranch.Clone(); 98 invokeNode.InsertSub Tree(newArgumentIndex, clonedArgumentBranch);98 invokeNode.InsertSubtree(newArgumentIndex, clonedArgumentBranch); 99 99 newlyAddedBranches.Add(clonedArgumentBranch); 100 100 } … … 102 102 from node in newlyAddedBranch.IterateNodesPrefix().OfType<InvokeFunctionTreeNode>() 103 103 where node.Symbol.FunctionName == selectedDefunBranch.FunctionName 104 where node.Sub Trees.Count() == selectedDefunBranch.NumberOfArguments104 where node.Subtrees.Count() == selectedDefunBranch.NumberOfArguments 105 105 select node).ToList(); 106 106 } … … 116 116 117 117 // increase the arity of the changed ADF in all branches that can use this ADF 118 foreach (var subtree in symbolicExpressionTree.Root.Sub Trees) {118 foreach (var subtree in symbolicExpressionTree.Root.Subtrees) { 119 119 var matchingInvokeSymbol = (from symb in subtree.Grammar.Symbols.OfType<InvokeFunction>() 120 120 where symb.FunctionName == selectedDefunBranch.FunctionName
Note: See TracChangeset
for help on using the changeset viewer.