Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/FullTreeCreator.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/FullTreeCreator.cs	(revision 7235)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/FullTreeCreator.cs	(revision 7236)
@@ -68,5 +68,5 @@
     }
 
-    public ISymbolicExpressionGrammar SymbolicExpressionTreeGrammar {
+    public ISymbolicExpressionGrammar ClonedSymbolicExpressionTreeGrammar {
       get { return ClonedSymbolicExpressionTreeGrammarParameter.ActualValue; }
     }
@@ -80,8 +80,12 @@
     public FullTreeCreator()
       : base() {
-      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
-      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
-      Parameters.Add(new ValueLookupParameter<ISymbolicExpressionGrammar>(SymbolicExpressionTreeGrammarParameterName, "The tree grammar that defines the correct syntax of symbolic expression trees that should be created."));
-      Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(ClonedSymbolicExpressionTreeGrammarParameterName, "An immutable clone of the concrete grammar that is actually used to create and manipulate trees."));
+      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)."));
+      Parameters.Add(new ValueLookupParameter<ISymbolicExpressionGrammar>(SymbolicExpressionTreeGrammarParameterName,
+        "The tree grammar that defines the correct syntax of symbolic expression trees that should be created."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(ClonedSymbolicExpressionTreeGrammarParameterName,
+        "An immutable clone of the concrete grammar that is actually used to create and manipulate trees."));
     }
 
@@ -97,5 +101,6 @@
           globalScope = globalScope.Parent;
 
-        globalScope.Variables.Add(new Variable(ClonedSymbolicExpressionTreeGrammarParameterName, (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone()));
+        globalScope.Variables.Add(new Variable(ClonedSymbolicExpressionTreeGrammarParameterName,
+          (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone()));
       }
       return base.Apply();
@@ -103,5 +108,5 @@
 
     protected override ISymbolicExpressionTree Create(IRandom random) {
-      return Create(random, SymbolicExpressionTreeGrammar, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value);
+      return Create(random, ClonedSymbolicExpressionTreeGrammar, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value);
     }
 
@@ -127,15 +132,15 @@
 
       var startNode = (SymbolicExpressionTreeTopLevelNode)grammar.StartSymbol.CreateTreeNode();
+      if (startNode.HasLocalParameters) startNode.ResetLocalParameters(random);
       startNode.SetGrammar(new SymbolicExpressionTreeGrammar(grammar));
-      if (startNode.HasLocalParameters) startNode.ResetLocalParameters(random);
 
       rootNode.AddSubtree(startNode);
 
-      Grow(random, startNode, maxTreeDepth - 2);
+      Create(random, startNode, maxTreeDepth - 2);
       tree.Root = rootNode;
       return tree;
     }
 
-    public static void Grow(IRandom random, ISymbolicExpressionTreeNode seedNode, int maxDepth) {
+    public static void Create(IRandom random, ISymbolicExpressionTreeNode seedNode, int maxDepth) {
       // make sure it is possible to create a trees smaller than maxDepth
       if (seedNode.Grammar.GetMinimumExpressionDepth(seedNode.Symbol) > maxDepth)
@@ -148,8 +153,12 @@
         throw new ArgumentException("Cannot grow tree. Seed node shouldn't have arity zero.");
 
-      var allowedSymbols = seedNode.Grammar.AllowedSymbols.Where(s => s.InitialFrequency > 0.0 && seedNode.Grammar.GetMaximumSubtreeCount(s) > 0).ToList();
-
-      for (var i = 0; i != arity; ++i) {
-        var possibleSymbols = allowedSymbols.Where(s => seedNode.Grammar.IsAllowedChildSymbol(seedNode.Symbol, s, i)).ToList();
+      var allowedSymbols = seedNode.Grammar.AllowedSymbols
+        .Where(s => s.InitialFrequency > 0.0 && seedNode.Grammar.GetMaximumSubtreeCount(s) > 0)
+        .ToList();
+
+      for (var i = 0; i < arity; i++) {
+        var possibleSymbols = allowedSymbols
+          .Where(s => seedNode.Grammar.IsAllowedChildSymbol(seedNode.Symbol, s, i))
+          .ToList();
         var selectedSymbol = possibleSymbols.SelectRandom(random);
         var tree = selectedSymbol.CreateTreeNode();
@@ -160,9 +169,10 @@
       // Only iterate over the non-terminal nodes (those which have arity > 0)
       // Start from depth 2 since the first two levels are formed by the rootNode and the seedNode
-      foreach (var subTree in seedNode.Subtrees.Where(subTree => subTree.Grammar.GetMaximumSubtreeCount(subTree.Symbol) > 0))
-        RecursiveGrowFull(random, subTree, 2, maxDepth);
-    }
-
-    public static void RecursiveGrowFull(IRandom random, ISymbolicExpressionTreeNode root, int currentDepth, int maxDepth) {
+      foreach (var subTree in seedNode.Subtrees)
+        if (subTree.Grammar.GetMaximumSubtreeCount(subTree.Symbol) > 0)
+          RecursiveCreate(random, subTree, 2, maxDepth);
+    }
+
+    private static void RecursiveCreate(IRandom random, ISymbolicExpressionTreeNode root, int currentDepth, int maxDepth) {
       var arity = root.Grammar.GetMaximumSubtreeCount(root.Symbol);
       // In the 'Full' grow method, we cannot have terminals on the intermediate tree levels.
@@ -170,10 +180,14 @@
         throw new ArgumentException("Cannot grow node of arity zero. Expected a function node.");
 
-      var allowedSymbols = root.Grammar.AllowedSymbols.Where(s => s.InitialFrequency > 0.0).ToList(); ;
-
-      for (var i = 0; i != arity; ++i) {
-        var possibleSymbols = allowedSymbols.Where(s => root.Grammar.IsAllowedChildSymbol(root.Symbol, s, i) &&
-                                                   root.Grammar.GetMinimumExpressionDepth(s) - 1 <= maxDepth - currentDepth &&
-                                                   root.Grammar.GetMaximumExpressionDepth(s) > maxDepth - currentDepth).ToList();
+      var allowedSymbols = root.Grammar.AllowedSymbols
+        .Where(s => s.InitialFrequency > 0.0)
+        .ToList();
+
+      for (var i = 0; i < arity; i++) {
+        var possibleSymbols = allowedSymbols
+          .Where(s => root.Grammar.IsAllowedChildSymbol(root.Symbol, s, i) &&
+            root.Grammar.GetMinimumExpressionDepth(s) - 1 <= maxDepth - currentDepth &&
+            root.Grammar.GetMaximumExpressionDepth(s) > maxDepth - currentDepth)
+          .ToList();
         if (!possibleSymbols.Any())
           throw new InvalidOperationException("No symbols are available for the tree.");
@@ -185,6 +199,7 @@
       }
 
-      foreach (var subTree in root.Subtrees.Where(subTree => subTree.Grammar.GetMaximumSubtreeCount(subTree.Symbol) > 0))
-        RecursiveGrowFull(random, subTree, currentDepth + 1, maxDepth);
+      foreach (var subTree in root.Subtrees)
+        if (subTree.Grammar.GetMaximumSubtreeCount(subTree.Symbol) > 0)
+          RecursiveCreate(random, subTree, currentDepth + 1, maxDepth);
     }
   }
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/GrowTreeCreator.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/GrowTreeCreator.cs	(revision 7235)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/GrowTreeCreator.cs	(revision 7236)
@@ -68,5 +68,5 @@
     }
 
-    public ISymbolicExpressionGrammar SymbolicExpressionTreeGrammar {
+    public ISymbolicExpressionGrammar ClonedSymbolicExpressionTreeGrammar {
       get { return ClonedSymbolicExpressionTreeGrammarParameter.ActualValue; }
     }
@@ -80,8 +80,12 @@
     public GrowTreeCreator()
       : base() {
-      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
-      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
-      Parameters.Add(new ValueLookupParameter<ISymbolicExpressionGrammar>(SymbolicExpressionTreeGrammarParameterName, "The tree grammar that defines the correct syntax of symbolic expression trees that should be created."));
-      Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(ClonedSymbolicExpressionTreeGrammarParameterName, "An immutable clone of the concrete grammar that is actually used to create and manipulate trees."));
+      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)."));
+      Parameters.Add(new ValueLookupParameter<ISymbolicExpressionGrammar>(SymbolicExpressionTreeGrammarParameterName,
+        "The tree grammar that defines the correct syntax of symbolic expression trees that should be created."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(ClonedSymbolicExpressionTreeGrammarParameterName,
+        "An immutable clone of the concrete grammar that is actually used to create and manipulate trees."));
     }
 
@@ -97,5 +101,6 @@
           globalScope = globalScope.Parent;
 
-        globalScope.Variables.Add(new Variable(ClonedSymbolicExpressionTreeGrammarParameterName, (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone()));
+        globalScope.Variables.Add(new Variable(ClonedSymbolicExpressionTreeGrammarParameterName,
+          (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone()));
       }
       return base.Apply();
@@ -103,5 +108,6 @@
 
     protected override ISymbolicExpressionTree Create(IRandom random) {
-      return Create(random, SymbolicExpressionTreeGrammar, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value);
+      return Create(random, ClonedSymbolicExpressionTreeGrammar,
+        MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value);
     }
 
@@ -126,15 +132,15 @@
 
       var startNode = (SymbolicExpressionTreeTopLevelNode)grammar.StartSymbol.CreateTreeNode();
+      if (startNode.HasLocalParameters) startNode.ResetLocalParameters(random);
       startNode.SetGrammar(new SymbolicExpressionTreeGrammar(grammar));
-      if (startNode.HasLocalParameters) startNode.ResetLocalParameters(random);
 
       rootNode.AddSubtree(startNode);
 
-      Grow(random, startNode, maxTreeDepth - 2);
+      Create(random, startNode, maxTreeDepth - 2);
       tree.Root = rootNode;
       return tree;
     }
 
-    public static void Grow(IRandom random, ISymbolicExpressionTreeNode seedNode, int maxDepth) {
+    public static void Create(IRandom random, ISymbolicExpressionTreeNode seedNode, int maxDepth) {
       // make sure it is possible to create a trees smaller than maxDepth
       if (seedNode.Grammar.GetMinimumExpressionDepth(seedNode.Symbol) > maxDepth)
@@ -146,8 +152,12 @@
         throw new ArgumentException("Cannot grow tree. Seed node shouldn't have arity zero.");
 
-      var allowedSymbols = seedNode.Grammar.AllowedSymbols.Where(s => s.InitialFrequency > 0.0).ToList();
-
-      for (var i = 0; i != arity; ++i) {
-        var possibleSymbols = allowedSymbols.Where(s => seedNode.Grammar.IsAllowedChildSymbol(seedNode.Symbol, s, i)).ToList();
+      var allowedSymbols = seedNode.Grammar.AllowedSymbols
+        .Where(s => s.InitialFrequency > 0.0)
+        .ToList();
+
+      for (var i = 0; i < arity; i++) {
+        var possibleSymbols = allowedSymbols
+          .Where(s => seedNode.Grammar.IsAllowedChildSymbol(seedNode.Symbol, s, i))
+          .ToList();
         var selectedSymbol = possibleSymbols.SelectRandom(random);
         var tree = selectedSymbol.CreateTreeNode();
@@ -158,17 +168,23 @@
       // Only iterate over the non-terminal nodes (those which have arity > 0)
       // Start from depth 2 since the first two levels are formed by the rootNode and the seedNode
-      foreach (var subTree in seedNode.Subtrees.Where(subTree => subTree.Grammar.GetMaximumSubtreeCount(subTree.Symbol) > 0))
-        RecursiveGrow(random, subTree, 2, maxDepth);
-    }
-
-    public static void RecursiveGrow(IRandom random, ISymbolicExpressionTreeNode root, int currentDepth, int maxDepth) {
+      foreach (var subTree in seedNode.Subtrees)
+        if (subTree.Grammar.GetMaximumSubtreeCount(subTree.Symbol) > 0)
+          RecursiveCreate(random, subTree, 2, maxDepth);
+    }
+
+    private static void RecursiveCreate(IRandom random, ISymbolicExpressionTreeNode root, int currentDepth, int maxDepth) {
       var arity = SampleArity(random, root);
       if (arity <= 0)
         throw new ArgumentException("Cannot grow node of arity zero. Expected a function node.");
 
-      var allowedSymbols = root.Grammar.AllowedSymbols.Where(s => s.InitialFrequency > 0.0).ToList();
-
-      for (var i = 0; i != arity; ++i) {
-        var possibleSymbols = allowedSymbols.Where(s => root.Grammar.IsAllowedChildSymbol(root.Symbol, s, i) && root.Grammar.GetMinimumExpressionDepth(s) - 1 <= maxDepth - currentDepth).ToList();
+      var allowedSymbols = root.Grammar.AllowedSymbols
+        .Where(s => s.InitialFrequency > 0.0)
+        .ToList();
+
+      for (var i = 0; i < arity; i++) {
+        var possibleSymbols = allowedSymbols
+          .Where(s => root.Grammar.IsAllowedChildSymbol(root.Symbol, s, i) &&
+            root.Grammar.GetMinimumExpressionDepth(s) - 1 <= maxDepth - currentDepth)
+          .ToList();
         if (!possibleSymbols.Any())
           throw new InvalidOperationException("No symbols are available for the tree.");
@@ -179,6 +195,7 @@
       }
 
-      foreach (var subTree in root.Subtrees.Where(subTree => subTree.Grammar.GetMaximumSubtreeCount(subTree.Symbol) != 0))
-        RecursiveGrow(random, subTree, currentDepth + 1, maxDepth);
+      foreach (var subTree in root.Subtrees)
+        if (subTree.Grammar.GetMaximumSubtreeCount(subTree.Symbol) != 0)
+          RecursiveCreate(random, subTree, currentDepth + 1, maxDepth);
     }
 
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/RampedHalfAndHalfTreeCreator.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/RampedHalfAndHalfTreeCreator.cs	(revision 7235)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/RampedHalfAndHalfTreeCreator.cs	(revision 7236)
@@ -20,8 +20,4 @@
 #endregion
 
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -54,7 +50,5 @@
     public IValueLookupParameter<ISymbolicExpressionGrammar> SymbolicExpressionTreeGrammarParameter {
       get {
-        return
-            (IValueLookupParameter<ISymbolicExpressionGrammar>)
-            Parameters[SymbolicExpressionTreeGrammarParameterName];
+        return (IValueLookupParameter<ISymbolicExpressionGrammar>)Parameters[SymbolicExpressionTreeGrammarParameterName];
       }
     }
@@ -62,7 +56,5 @@
     public ILookupParameter<ISymbolicExpressionGrammar> ClonedSymbolicExpressionTreeGrammarParameter {
       get {
-        return
-            (ILookupParameter<ISymbolicExpressionGrammar>)
-            Parameters[ClonedSymbolicExpressionTreeGrammarParameterName];
+        return (ILookupParameter<ISymbolicExpressionGrammar>)Parameters[ClonedSymbolicExpressionTreeGrammarParameterName];
       }
     }
@@ -78,5 +70,5 @@
     }
 
-    public ISymbolicExpressionGrammar SymbolicExpressionTreeGrammar {
+    public ISymbolicExpressionGrammar ClonedSymbolicExpressionTreeGrammar {
       get { return ClonedSymbolicExpressionTreeGrammarParameter.ActualValue; }
     }
@@ -89,8 +81,12 @@
     public RampedHalfAndHalfTreeCreator()
       : base() {
-      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
-      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
-      Parameters.Add(new ValueLookupParameter<ISymbolicExpressionGrammar>(SymbolicExpressionTreeGrammarParameterName, "The tree grammar that defines the correct syntax of symbolic expression trees that should be created."));
-      Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(ClonedSymbolicExpressionTreeGrammarParameterName, "An immutable clone of the concrete grammar that is actually used to create and manipulate trees."));
+      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)."));
+      Parameters.Add(new ValueLookupParameter<ISymbolicExpressionGrammar>(SymbolicExpressionTreeGrammarParameterName,
+        "The tree grammar that defines the correct syntax of symbolic expression trees that should be created."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(ClonedSymbolicExpressionTreeGrammarParameterName,
+        "An immutable clone of the concrete grammar that is actually used to create and manipulate trees."));
     }
 
@@ -106,5 +102,6 @@
           globalScope = globalScope.Parent;
 
-        globalScope.Variables.Add(new Variable(ClonedSymbolicExpressionTreeGrammarParameterName, (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone()));
+        globalScope.Variables.Add(new Variable(ClonedSymbolicExpressionTreeGrammarParameterName,
+          (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone()));
       }
       return base.Apply();
@@ -112,5 +109,5 @@
 
     protected override ISymbolicExpressionTree Create(IRandom random) {
-      return Create(random, SymbolicExpressionTreeGrammar, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value);
+      return Create(random, ClonedSymbolicExpressionTreeGrammar, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value);
     }
 
@@ -125,4 +122,5 @@
     /// <param name="random">Random generator</param>
     /// <param name="grammar">Available tree grammar</param>
+    /// <param name="maxTreeLength">Maximum tree length (this parameter is ignored)</param>
     /// <param name="maxTreeDepth">Maximum tree depth</param>
     /// <returns></returns>
@@ -134,6 +132,6 @@
 
       var startNode = (SymbolicExpressionTreeTopLevelNode)grammar.StartSymbol.CreateTreeNode();
+      if (startNode.HasLocalParameters) startNode.ResetLocalParameters(random);
       startNode.SetGrammar(new SymbolicExpressionTreeGrammar(grammar));
-      if (startNode.HasLocalParameters) startNode.ResetLocalParameters(random);
 
       rootNode.AddSubtree(startNode);
@@ -142,7 +140,7 @@
 
       if (p < 0.5)
-        GrowTreeCreator.Grow(random, startNode, maxTreeDepth - 2);
+        GrowTreeCreator.Create(random, startNode, maxTreeDepth - 2);
       else
-        FullTreeCreator.Grow(random, startNode, maxTreeDepth - 2);
+        FullTreeCreator.Create(random, startNode, maxTreeDepth - 2);
 
       tree.Root = rootNode;
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeGrammar.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeGrammar.cs	(revision 7235)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeGrammar.cs	(revision 7236)
@@ -45,5 +45,5 @@
     private ISymbolicExpressionGrammar grammar;
     public SymbolicExpressionTreeGrammar(ISymbolicExpressionGrammar grammar)
-      : base("SymbolicExpressionTreeGrammar", "A grammar that is used held by symbolic expression trees and allows extensions to the wraped grammar.") {
+      : base("SymbolicExpressionTreeGrammar", "A grammar that is used held by symbolic expression trees and allows extensions to the wrapped grammar.") {
       if (grammar == null) throw new ArgumentNullException();
       this.grammar = grammar;
