Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/17/11 11:51:09 (12 years ago)
Author:
bburlacu
Message:

#1654: Updated Full-, Grow- and RampedHalfAndHalf tree creators so that the Create call has the exact same signature for all of them (including the probabilistic tree creator); adjusted tests. Added CreateTree interface method and tree creator selection mechanism in the Sample Tree View.

File:
1 edited

Legend:

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

    r6944 r7012  
    2727using HeuristicLab.Parameters;
    2828using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     29using HeuristicLab.PluginInfrastructure;
    2930
    3031namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
     32  [NonDiscoverableType]
    3133  [StorableClass]
    3234  [Item("FullTreeCreator", "An operator that creates new symbolic expression trees using the 'Full' method")]
     
    6062    public IntValue MaximumSymbolicExpressionTreeDepth {
    6163      get { return MaximumSymbolicExpressionTreeDepthParameter.ActualValue; }
     64    }
     65   
     66    public IntValue MaximumSymbolicExpressionTreeLength {
     67      get { return MaximumSymbolicExpressionTreeLengthParameter.ActualValue; }
    6268    }
    6369
     
    97103
    98104    protected override ISymbolicExpressionTree Create(IRandom random) {
    99       return Create(random, SymbolicExpressionTreeGrammar, MaximumSymbolicExpressionTreeDepth.Value);
     105      return Create(random, SymbolicExpressionTreeGrammar, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value);
     106    }
     107
     108    public override ISymbolicExpressionTree CreateTree(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) {
     109     return Create(random, grammar, maxTreeLength, maxTreeDepth);
    100110    }
    101111
     
    108118    /// <param name="grammar">Available tree grammar</param>
    109119    /// <param name="maxTreeDepth">Maximum tree depth</param>
     120    /// <param name="maxTreeLength">Maximum tree length. This parameter is not used.</param>
    110121    /// <returns></returns>
    111     public static ISymbolicExpressionTree Create(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeDepth) {
     122    public static ISymbolicExpressionTree Create(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) {
    112123      var tree = new SymbolicExpressionTree();
    113124      var rootNode = (SymbolicExpressionTreeTopLevelNode)grammar.ProgramRootSymbol.CreateTreeNode();
Note: See TracChangeset for help on using the changeset viewer.