Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/25/15 18:21:19 (9 years ago)
Author:
dglaser
Message:

#2388: Merged trunk into HiveStatistics branch

Location:
branches/HiveStatistics/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding

  • branches/HiveStatistics/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SymbolicExpressionGrammarBase.cs

    r12422 r12515  
    338338        List<string> temp;
    339339        if (allowedChildSymbols.TryGetValue(parent.Name, out temp)) {
    340           if (temp.SelectMany(s => GetSymbol(s).Flatten()).Any(s => s.Name == child.Name)) {
    341             cachedIsAllowedChildSymbol.Add(key, true);
    342             return true;
     340          for (int i = 0; i < temp.Count; i++) {
     341            var symbol = GetSymbol(temp[i]);
     342            foreach (var s in symbol.Flatten())
     343              if (s.Name == child.Name) {
     344                cachedIsAllowedChildSymbol.Add(key, true);
     345                return true;
     346              }
    343347          }
    344348        }
     
    365369        List<string> temp;
    366370        if (allowedChildSymbolsPerIndex.TryGetValue(Tuple.Create(parent.Name, argumentIndex), out temp)) {
    367           if (temp.SelectMany(s => GetSymbol(s).Flatten()).Any(s => s.Name == child.Name)) {
    368             cachedIsAllowedChildSymbolIndex.Add(key, true);
    369             return true;
     371          for (int i = 0; i < temp.Count; i++) {
     372            var symbol = GetSymbol(temp[i]);
     373            foreach (var s in symbol.Flatten())
     374              if (s.Name == child.Name) {
     375                cachedIsAllowedChildSymbolIndex.Add(key, true);
     376                return true;
     377              }
    370378          }
    371379        }
Note: See TracChangeset for help on using the changeset viewer.