Changeset 6233 for trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators
- Timestamp:
- 05/19/11 13:52:12 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineDuplicater.cs
r5809 r6233 83 83 subtree.Grammar.SetSubtreeCount(invokeSymbol, duplicatedDefunBranch.NumberOfArguments, duplicatedDefunBranch.NumberOfArguments); 84 84 85 foreach ( Symbol symbol in subtree.Grammar.Symbols) {85 foreach (ISymbol symbol in subtree.Grammar.Symbols) { 86 86 if (subtree.Grammar.IsAllowedChildSymbol(symbol, matchingInvokeSymbol)) 87 87 subtree.Grammar.AddAllowedChildSymbol(symbol, invokeSymbol); … … 93 93 } 94 94 95 foreach ( Symbol symbol in subtree.Grammar.GetAllowedChildSymbols(matchingInvokeSymbol))95 foreach (ISymbol symbol in subtree.Grammar.GetAllowedChildSymbols(matchingInvokeSymbol)) 96 96 if (symbol != invokeSymbol) //avoid duplicate entry invokesymbol / invokesymbol 97 97 subtree.Grammar.AddAllowedChildSymbol(invokeSymbol, symbol); 98 98 for (int i = 0; i < subtree.Grammar.GetMaximumSubtreeCount(matchingInvokeSymbol); i++) { 99 foreach ( Symbol symbol in subtree.Grammar.GetAllowedChildSymbols(matchingInvokeSymbol, i).Except(subtree.Grammar.GetAllowedChildSymbols(matchingInvokeSymbol)))99 foreach (ISymbol symbol in subtree.Grammar.GetAllowedChildSymbols(matchingInvokeSymbol, i).Except(subtree.Grammar.GetAllowedChildSymbols(matchingInvokeSymbol))) 100 100 subtree.Grammar.AddAllowedChildSymbol(invokeSymbol, symbol, i); 101 101 }
Note: See TracChangeset
for help on using the changeset viewer.