Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12346


Ignore:
Timestamp:
04/24/15 11:52:00 (10 years ago)
Author:
mkommend
Message:

#2320: Small bug fix in FullTreeCreator to account for symbols that could be used in leafe and internal nodes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SymbolicExpressionTreeEncoding/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/FullTreeCreator.cs

    r12313 r12346  
    2424using HeuristicLab.Common;
    2525using HeuristicLab.Core;
    26 using HeuristicLab.Data;
    27 using HeuristicLab.Parameters;
    2826using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2927using HeuristicLab.PluginInfrastructure;
     
    142140      }
    143141
    144       foreach (var subTree in root.Subtrees)
    145         if (subTree.Grammar.GetMaximumSubtreeCount(subTree.Symbol) > 0)
    146           RecursiveCreate(random, subTree, currentDepth + 1, maxDepth);
     142      //additional levels should only be added if the maximum depth is not reached yet
     143      if (maxDepth > currentDepth) {
     144        foreach (var subTree in root.Subtrees)
     145          if (subTree.Grammar.GetMaximumSubtreeCount(subTree.Symbol) > 0)
     146            RecursiveCreate(random, subTree, currentDepth + 1, maxDepth);
     147      }
    147148    }
    148149  }
Note: See TracChangeset for help on using the changeset viewer.