Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5015 for trunk/sources


Ignore:
Timestamp:
12/03/10 15:17:25 (13 years ago)
Author:
mkommend
Message:

Moved check for max expression depth from tree node to the manipulator and corrected `MultiSymbolicExpressionTreeArchitectureManipulator' (ticket #1315).

Location:
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs

    r4722 r5015  
    116116        manipulator.SymbolicExpressionGrammarParameter.ActualName = SymbolicExpressionGrammarParameter.Name;
    117117        manipulator.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name;
    118         manipulator.MaxFunctionDefinitionsParameter.ActualName = MaxFunctionArgumentsParameter.Name;
     118        manipulator.MaxFunctionDefinitionsParameter.ActualName = MaxFunctionDefinitionsParameter.Name;
    119119        manipulator.MaxFunctionArgumentsParameter.ActualName = MaxFunctionArgumentsParameter.Name;
    120120      }
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/ReplaceBranchManipulation.cs

    r5014 r5015  
    5757      int maxHeight = maxTreeHeight - symbolicExpressionTree.Height + manipulationPoint.Node.GetHeight();
    5858      // find possible symbols for the node (also considering the existing branches below it)
    59       var allowedSymbols = from symbol in manipulationPoint.Parent.GetAllowedSymbols(manipulationPoint.Index, maxHeight)
     59      var allowedSymbols = from symbol in manipulationPoint.Parent.GetAllowedSymbols(manipulationPoint.Index)
     60                           where manipulationPoint.Node.Grammar.GetMinExpressionDepth(symbol) <= maxHeight
     61                           where manipulationPoint.Node.Grammar.GetMinExpressionLength(symbol) <= maxSize
    6062                           select symbol;
    6163      if (allowedSymbols.Count() <= 1) return;
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeNode.cs

    r5014 r5015  
    178178      return Grammar.Symbols.Where(s => Grammar.IsAllowedChild(Symbol, s, argumentIndex));
    179179    }
    180     public IEnumerable<Symbol> GetAllowedSymbols(int argumentIndex, int maxExpressionDepth) {
    181       return Grammar.Symbols.Where(s => Grammar.IsAllowedChild(Symbol, s, argumentIndex) && Grammar.GetMinExpressionDepth(s) <= maxExpressionDepth);
    182     }
    183180
    184181    public int GetMinSubtreeCount() {
Note: See TracChangeset for help on using the changeset viewer.