Index: branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/FullTreeCreator.cs
===================================================================
--- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/FullTreeCreator.cs	(revision 12155)
+++ branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/FullTreeCreator.cs	(revision 12891)
@@ -24,6 +24,4 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 using HeuristicLab.PluginInfrastructure;
@@ -36,26 +34,4 @@
                                  ISymbolicExpressionTreeSizeConstraintOperator,
                                  ISymbolicExpressionTreeGrammarBasedOperator {
-    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
-    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
-
-    #region Parameter Properties
-    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
-    }
-
-    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
-    }
-    #endregion
-    #region Properties
-    public IntValue MaximumSymbolicExpressionTreeDepth {
-      get { return MaximumSymbolicExpressionTreeDepthParameter.ActualValue; }
-    }
-
-    public IntValue MaximumSymbolicExpressionTreeLength {
-      get { return MaximumSymbolicExpressionTreeLengthParameter.ActualValue; }
-    }
-
-    #endregion
 
     [StorableConstructor]
@@ -63,11 +39,5 @@
     protected FullTreeCreator(FullTreeCreator original, Cloner cloner) : base(original, cloner) { }
 
-    public FullTreeCreator()
-      : base() {
-      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName,
-        "The maximal length (number of nodes) of the symbolic expression tree (this parameter is ignored)."));
-      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName,
-        "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
-    }
+    public FullTreeCreator() : base() { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -77,5 +47,6 @@
 
     protected override ISymbolicExpressionTree Create(IRandom random) {
-      return Create(random, ClonedSymbolicExpressionTreeGrammarParameter.ActualValue, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value);
+      return Create(random, ClonedSymbolicExpressionTreeGrammarParameter.ActualValue,
+          MaximumSymbolicExpressionTreeLengthParameter.ActualValue.Value, MaximumSymbolicExpressionTreeDepthParameter.ActualValue.Value);
     }
 
@@ -106,5 +77,5 @@
       rootNode.AddSubtree(startNode);
 
-      Create(random, startNode, maxTreeDepth - 2);
+      Create(random, startNode, maxTreeDepth-1);
       tree.Root = rootNode;
       return tree;
@@ -128,8 +99,14 @@
       for (var i = 0; i < arity; i++) {
         var possibleSymbols = allowedSymbols
-          .Where(s => seedNode.Grammar.IsAllowedChildSymbol(seedNode.Symbol, s, i))
+          .Where(s => seedNode.Grammar.IsAllowedChildSymbol(seedNode.Symbol, s, i)
+                   && seedNode.Grammar.GetMinimumExpressionDepth(s) <= maxDepth
+                   && seedNode.Grammar.GetMaximumExpressionDepth(s) >= maxDepth)
           .ToList();
         var weights = possibleSymbols.Select(s => s.InitialFrequency).ToList();
+
+#pragma warning disable 612, 618
         var selectedSymbol = possibleSymbols.SelectRandom(weights, random);
+#pragma warning restore 612, 618
+
         var tree = selectedSymbol.CreateTreeNode();
         if (tree.HasLocalParameters) tree.ResetLocalParameters(random);
@@ -163,5 +140,9 @@
           throw new InvalidOperationException("No symbols are available for the tree.");
         var weights = possibleSymbols.Select(s => s.InitialFrequency).ToList();
+
+#pragma warning disable 612, 618
         var selectedSymbol = possibleSymbols.SelectRandom(weights, random);
+#pragma warning restore 612, 618
+
         var tree = selectedSymbol.CreateTreeNode();
         if (tree.HasLocalParameters) tree.ResetLocalParameters(random);
@@ -169,7 +150,10 @@
       }
 
-      foreach (var subTree in root.Subtrees)
-        if (subTree.Grammar.GetMaximumSubtreeCount(subTree.Symbol) > 0)
-          RecursiveCreate(random, subTree, currentDepth + 1, maxDepth);
+      //additional levels should only be added if the maximum depth is not reached yet
+      if (maxDepth > currentDepth) {
+        foreach (var subTree in root.Subtrees)
+          if (subTree.Grammar.GetMaximumSubtreeCount(subTree.Symbol) > 0)
+            RecursiveCreate(random, subTree, currentDepth + 1, maxDepth);
+      }
     }
   }
