Changeset 7079


Ignore:
Timestamp:
11/27/11 22:40:34 (8 years ago)
Author:
mkommend
Message:

#1654: Added caching in SymbolicExpressionGrammarBase and changed depth limit for FullTreeCreator unit test.

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeGrammar.cs

    r6911 r7079  
    119119      else return base.GetMinimumExpressionDepth(symbol);
    120120    }
     121    int ISymbolicExpressionGrammarBase.GetMaximumExpressionDepth(ISymbol symbol) {
     122      if (symbols.Count == 0) return grammar.GetMaximumExpressionDepth(symbol);
     123      else return base.GetMaximumExpressionDepth(symbol);
     124    }
    121125    int ISymbolicExpressionGrammarBase.GetMinimumExpressionLength(ISymbol symbol) {
    122126      if (symbols.Count == 0) return grammar.GetMinimumExpressionLength(symbol);
     
    127131      else return base.GetMaximumExpressionLength(symbol, maxDepth);
    128132    }
     133
    129134  }
    130135}
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4/FullTreeCreatorTest.cs

    r7053 r7079  
    3131  public class FullTreeCreatorTest {
    3232    private const int POPULATION_SIZE = 10000;
    33     private const int MAX_TREE_DEPTH = 10;
    34     private const int MAX_TREE_LENGTH = 1000;
     33    private const int MAX_TREE_DEPTH = 9 ;
     34    private const int MAX_TREE_LENGTH = 256;
    3535    private TestContext testContextInstance;
    3636
Note: See TracChangeset for help on using the changeset viewer.