Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/17/11 14:07:47 (13 years ago)
Author:
mkommend
Message:

#1418: Corrected problem interfaces & unified naming of subtrees.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentDuplicater.cs

    r5686 r5733  
    8686      var invocationNodes = (from node in symbolicExpressionTree.IterateNodesPrefix().OfType<InvokeFunctionTreeNode>()
    8787                             where node.Symbol.FunctionName == selectedDefunBranch.FunctionName
    88                              where node.SubTrees.Count() == selectedDefunBranch.NumberOfArguments
     88                             where node.Subtrees.Count() == selectedDefunBranch.NumberOfArguments
    8989                             select node).ToList();
    9090      // do this repeatedly until no matching invocations are found     
     
    9393        foreach (var invokeNode in invocationNodes) {
    9494          // check that the invocation node really has the correct number of arguments
    95           if (invokeNode.SubTrees.Count() != selectedDefunBranch.NumberOfArguments) throw new InvalidOperationException();
    96           var argumentBranch = invokeNode.GetSubTree(selectedArgumentSymbol.ArgumentIndex);
     95          if (invokeNode.Subtrees.Count() != selectedDefunBranch.NumberOfArguments) throw new InvalidOperationException();
     96          var argumentBranch = invokeNode.GetSubtree(selectedArgumentSymbol.ArgumentIndex);
    9797          var clonedArgumentBranch = (ISymbolicExpressionTreeNode)argumentBranch.Clone();
    98           invokeNode.InsertSubTree(newArgumentIndex, clonedArgumentBranch);
     98          invokeNode.InsertSubtree(newArgumentIndex, clonedArgumentBranch);
    9999          newlyAddedBranches.Add(clonedArgumentBranch);
    100100        }
     
    102102                           from node in newlyAddedBranch.IterateNodesPrefix().OfType<InvokeFunctionTreeNode>()
    103103                           where node.Symbol.FunctionName == selectedDefunBranch.FunctionName
    104                            where node.SubTrees.Count() == selectedDefunBranch.NumberOfArguments
     104                           where node.Subtrees.Count() == selectedDefunBranch.NumberOfArguments
    105105                           select node).ToList();
    106106      }
     
    116116
    117117      // increase the arity of the changed ADF in all branches that can use this ADF
    118       foreach (var subtree in symbolicExpressionTree.Root.SubTrees) {
     118      foreach (var subtree in symbolicExpressionTree.Root.Subtrees) {
    119119        var matchingInvokeSymbol = (from symb in subtree.Grammar.Symbols.OfType<InvokeFunction>()
    120120                                    where symb.FunctionName == selectedDefunBranch.FunctionName
Note: See TracChangeset for help on using the changeset viewer.