Index: /branches/HeuristicLab.Problems.GPDL/CodeGenerator/ProblemCodeGen.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/CodeGenerator/ProblemCodeGen.cs	(revision 10384)
+++ /branches/HeuristicLab.Problems.GPDL/CodeGenerator/ProblemCodeGen.cs	(revision 10385)
@@ -18,4 +18,5 @@
     private const string problemTemplate = @"
 namespace ?PROBLEMNAME? {
+#region class definitions for tree
   public class Tree {
     public int altIdx;
@@ -31,12 +32,5 @@
 
   ?TERMINALNODECLASSDEFINITIONS?
-
-  // generic interface for communication from problem interpretation to solver
-  // public interface ISolverState {
-  //   void Reset();
-  //   int PeekNextAlternative(); // in alternative nodes returns the index of the alternative that should be followed
-  //   void Follow(int idx); // next: derive the NT symbol with index=idx;
-  //   void Unwind(); // finished with deriving the NT symbol
-  // }
+#endregion
 
   public sealed class ?IDENT?Problem {
@@ -221,18 +215,18 @@
       foreach (var constr in terminal.Constraints) {
         if (constr.Type == ConstraintNodeType.Set) {
-          sb.AppendLine("{").BeginBlock();
+          sb.Append("{").BeginBlock();
           sb.AppendFormat("var elements = problem.GetAllowed{0}_{1}().ToArray();", terminal.Ident, constr.Ident).AppendLine();
           sb.AppendFormat("{0} = elements[random.Next(elements.Length)]; ", constr.Ident).AppendLine();
-          sb.AppendLine("}").EndBlock();
+          sb.Append("}").EndBlock();
         } else {
-          sb.AppendLine("{").BeginBlock();
+          sb.Append("{").BeginBlock();
           sb.AppendFormat(" var max = problem.GetMax{0}_{1}();", terminal.Ident, constr.Ident).AppendLine();
           sb.AppendFormat(" var min = problem.GetMin{0}_{1}();", terminal.Ident, constr.Ident).AppendLine();
-          sb.AppendFormat("{0} = random.NextDouble() * (max - min) + min;", constr.Ident).AppendLine();
-          sb.AppendLine("}").EndBlock();
-        }
-      }
-      sb.AppendLine("}").EndBlock();
-      sb.AppendLine("}").EndBlock();
+          sb.AppendFormat("{0} = random.NextDouble() * (max - min) + min;", constr.Ident).EndBlock();
+          sb.Append("}").EndBlock();
+        }
+      }
+      sb.Append("}").EndBlock();
+      sb.AppendLine("}");
     }
 
Index: /branches/HeuristicLab.Problems.GPDL/CodeGenerator/RandomSearchCodeGen.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/CodeGenerator/RandomSearchCodeGen.cs	(revision 10384)
+++ /branches/HeuristicLab.Problems.GPDL/CodeGenerator/RandomSearchCodeGen.cs	(revision 10385)
@@ -29,5 +29,4 @@
       public int steps;
       public int depth;
-      // private readonly Stack<Tree> nodes;
       private readonly ?IDENT?Problem problem;
       private Random random;
@@ -35,14 +34,6 @@
       public SolverState(?IDENT?Problem problem, int seed) {
         this.problem = problem;
-        // this.nodes = new Stack<Tree>();
-        
         this.random = new Random(seed);
-        // nodes.Push(tree);
-      }
-
-      // public void Reset() {
-      //   // stack must contain only the root of the tree
-      //   System.Diagnostics.Debug.Assert(nodes.Count == 1);
-      // }
+      }
 
       public Tree SampleTree() {
@@ -87,18 +78,4 @@
         }
       }
-
-      // public int PeekNextAlternative() {
-      //   // this must only be called nodes that contain alternatives and therefore must only have single-symbols alternatives
-      //   System.Diagnostics.Debug.Assert(nodes.Peek().subtrees.Count == 1);
-      //   return nodes.Peek().subtrees[0].altIdx;
-      // }
-      // 
-      // public void Follow(int idx) {
-      //   nodes.Push(nodes.Peek().subtrees[idx]);
-      // }
-      // 
-      // public void Unwind() {
-      //   nodes.Pop();
-      // }
 
       private int SampleAlternative(Random random, int state) {
@@ -167,5 +144,5 @@
       var sw = new System.Diagnostics.Stopwatch();
       sw.Start();
-      while (true) {
+      while (n <= 10000) {
 
         var _state = new SolverState(problem, seedRandom.Next());
@@ -184,9 +161,8 @@
           sw.Stop();
           Console.WriteLine(""{0}\tbest: {1:0.000}\t(avg: {2:0.000})\t(avg size: {3:0.0})\t(avg. depth: {4:0.0})\t({5:0.00} sols/ms)"", n, bestF, sumF/1000.0, sumSize/1000.0, sumDepth/1000.0, 1000.0 / sw.ElapsedMilliseconds);
-          sw.Reset();
           sumSize = 0;
           sumDepth = 0;
           sumF = 0.0;
-          sw.Start();
+          sw.Restart();
         }
       }
@@ -202,6 +178,4 @@
       var solverSourceCode = new SourceBuilder();
       solverSourceCode.Append(solverTemplate)
-        // .Replace("?TERMINALFIELDS?", GenerateTerminalFields(grammar))
-        // .Replace("?CONSTRUCTORCODE?", GenerateConstructorCode(grammar))
         .Replace("?MAXIMIZATION?", maximization.ToString().ToLowerInvariant())
         .Replace("?SYMBOLNAMES?", grammar.Symbols.Select(s => s.Name).Aggregate(string.Empty, (str, symb) => str + "\"" + symb + "\", "))
@@ -210,5 +184,4 @@
         .Replace("?SUBTREECOUNTTABLE?", GenerateSubtreeCountTable(grammar))
         .Replace("?SAMPLEALTERNATIVECODE?", GenerateSampleAlternativeSource(grammar))
-        //        .Replace("?SAMPLETERMINALCODE?", GenerateSampleTerminalSource(grammar))
       ;
 
@@ -217,16 +190,4 @@
 
 
-    //private string GenerateSampleTerminalSource(IGrammar grammar) {
-    //  StringBuilder sb = new StringBuilder();
-    //  foreach (var t in grammar.TerminalSymbols) {
-    //    sb.AppendFormat("public void {0}(ISolverState _state, {1}) {{", t.Name, t.GetAttributeString()).AppendLine();
-    //    foreach (var att in t.Attributes) {
-    //      // need constraints
-    //      sb.AppendFormat("{0}", att.Name);
-    //    }
-    //    sb.AppendLine("}");
-    //  }
-    //  return sb.ToString();
-    //}
     private string GenerateCreateTerminalCode(IGrammar grammar) {
       Debug.Assert(grammar.Symbols.First().Equals(grammar.StartSymbol));
Index: /branches/HeuristicLab.Problems.GPDL/CodeGenerator/SourceBuilder.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/CodeGenerator/SourceBuilder.cs	(revision 10384)
+++ /branches/HeuristicLab.Problems.GPDL/CodeGenerator/SourceBuilder.cs	(revision 10385)
@@ -33,9 +33,9 @@
     }
     public SourceBuilder AppendLine() {
-      sb.AppendLine();
+      sb.Append(' ', indent).AppendLine();
       return this;
     }
     public SourceBuilder AppendLine(string str) {
-      sb.AppendLine(str);
+      sb.Append(' ', indent).AppendLine(str);
       return this;
     }
Index: /branches/HeuristicLab.Problems.GPDL/TestExamples.bat
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/TestExamples.bat	(revision 10384)
+++ /branches/HeuristicLab.Problems.GPDL/TestExamples.bat	(revision 10385)
@@ -6,2 +6,8 @@
   csc /optimize+ "%%i"
 )
+
+
+for /f "delims=" %%i in ('dir /b *.exe') do (
+  "%%i"
+)
+
