Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/15/11 13:34:38 (13 years ago)
Author:
mkommend
Message:

#1418: Finally added results from the grammar refactoring.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ChangeNodeTypeManipulation.cs

    r5567 r5686  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    2422using System.Linq;
    2523using HeuristicLab.Common;
    2624using HeuristicLab.Core;
    27 using HeuristicLab.Data;
    2825using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2926
     
    5350                                let existingSubtreeCount = subtree.SubTrees.Count()
    5451                                // find possible symbols for the node (also considering the existing branches below it)
    55                                 let allowedSymbols = (from symbol in parent.Grammar.GetAllowedSymbols(parent.Symbol, subtreeIndex)
     52                                let allowedSymbols = (from symbol in parent.Grammar.GetAllowedChildSymbols(parent.Symbol, subtreeIndex)
    5653                                                      // do not replace the existing symbol with itself
    5754                                                      where symbol.Name != subtree.Symbol.Name
    58                                                       where existingSubtreeCount <= parent.Grammar.GetMaxSubtreeCount(symbol)
    59                                                       where existingSubtreeCount >= parent.Grammar.GetMinSubtreeCount(symbol)
     55                                                      where existingSubtreeCount <= parent.Grammar.GetMaximumSubtreeCount(symbol)
     56                                                      where existingSubtreeCount >= parent.Grammar.GetMinimumSubtreeCount(symbol)
    6057                                                      // keep only symbols that are still possible considering the existing sub-trees
    6158                                                      where (from existingSubtreeIndex in Enumerable.Range(0, existingSubtreeCount)
    6259                                                             let existingSubtree = subtree.GetSubTree(existingSubtreeIndex)
    63                                                              select parent.Grammar.IsAllowedChild(symbol, existingSubtree.Symbol, existingSubtreeIndex))
     60                                                             select parent.Grammar.IsAllowedChildSymbol(symbol, existingSubtree.Symbol, existingSubtreeIndex))
    6461                                                             .All(x => x == true)
    6562                                                      select symbol)
Note: See TracChangeset for help on using the changeset viewer.