Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/20/11 11:12:10 (13 years ago)
Author:
mkommend
Message:

#1479: Merged grammar editor branch into trunk.

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding

    • Property svn:ignore set to
      bin
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SubtreeCrossover.cs

    r5916 r6803  
    9696      int maxInsertedBranchDepth = maxTreeDepth - GetBranchLevel(parent0.Root, crossoverPoint0.Parent);
    9797
    98 
    9998      List<ISymbolicExpressionTreeNode> allowedBranches = new List<ISymbolicExpressionTreeNode>();
    10099      parent1.Root.ForEachNodePostfix((n) => {
    101100        if (n.GetLength() <= maxInsertedBranchLength &&
    102           n.GetDepth() <= maxInsertedBranchDepth &&
    103           IsMatchingPointType(crossoverPoint0, n))
     101            n.GetDepth() <= maxInsertedBranchDepth &&
     102            IsMatchingPointType(crossoverPoint0, n))
    104103          allowedBranches.Add(n);
    105104      });
     
    133132      if (newChild == null) {
    134133        // make sure that one subtree can be removed and that only the last subtree is removed
    135         return parent.Grammar.GetMinimumSubtreeCount(parent.Symbol) < parent.SubtreesCount &&
    136           cutPoint.ChildIndex == parent.SubtreesCount - 1;
     134        return parent.Grammar.GetMinimumSubtreeCount(parent.Symbol) < parent.SubtreeCount &&
     135          cutPoint.ChildIndex == parent.SubtreeCount - 1;
    137136      } else {
    138137        // check syntax constraints of direct parent - child relation
     
    146145            result &&
    147146            parent.Grammar.ContainsSymbol(n.Symbol) &&
    148             n.SubtreesCount >= parent.Grammar.GetMinimumSubtreeCount(n.Symbol) &&
    149             n.SubtreesCount <= parent.Grammar.GetMaximumSubtreeCount(n.Symbol);
     147            n.SubtreeCount >= parent.Grammar.GetMinimumSubtreeCount(n.Symbol) &&
     148            n.SubtreeCount <= parent.Grammar.GetMaximumSubtreeCount(n.Symbol);
    150149        });
    151150        return result;
     
    169168          }
    170169          // add one additional extension point if the number of sub trees for the symbol is not full
    171           if (n.SubtreesCount < n.Grammar.GetMaximumSubtreeCount(n.Symbol)) {
     170          if (n.SubtreeCount < n.Grammar.GetMaximumSubtreeCount(n.Symbol)) {
    172171            // empty extension point
    173             internalCrossoverPoints.Add(new CutPoint(n, n.SubtreesCount));
     172            internalCrossoverPoints.Add(new CutPoint(n, n.SubtreeCount));
    174173          }
    175174        }
Note: See TracChangeset for help on using the changeset viewer.