Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3998


Ignore:
Timestamp:
07/06/10 12:33:30 (14 years ago)
Author:
gkronber
Message:

Minor efficiency improvement in crossover for symbolic expression trees. #1073

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Crossovers/SubtreeCrossover.cs

    r3997 r3998  
    9797      // check point type for the whole branch
    9898      branch.ForEachNodePostfix((n) => {
    99         result &= n.SubTrees.Count >= parent.Grammar.GetMinSubtreeCount(n.Symbol);
    100         result &= n.SubTrees.Count <= parent.Grammar.GetMaxSubtreeCount(n.Symbol);
    101         result &= parent.Grammar.ContainsSymbol(n.Symbol);
     99        result =
     100          result &&
     101          n.SubTrees.Count >= parent.Grammar.GetMinSubtreeCount(n.Symbol) &&
     102          n.SubTrees.Count <= parent.Grammar.GetMaxSubtreeCount(n.Symbol) &&
     103          parent.Grammar.ContainsSymbol(n.Symbol);
    102104      });
    103105      return result;
Note: See TracChangeset for help on using the changeset viewer.