Index: branches/HeuristicLab.Problems.GPDL/CodeGenerator/BruteForceCodeGen.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/CodeGenerator/BruteForceCodeGen.cs	(revision 10424)
+++ branches/HeuristicLab.Problems.GPDL/CodeGenerator/BruteForceCodeGen.cs	(revision 10425)
@@ -13,4 +13,5 @@
 namespace ?PROBLEMNAME? {
   public sealed class ?IDENT?Solver {
+    private static int maxDepth = 20;
 
     private readonly ?IDENT?Problem problem;
@@ -73,8 +74,35 @@
 
     public static void Main(string[] args) {
+      if(args.Length > 0) ParseArguments(args);
       var problem = new ?IDENT?Problem();
       var solver = new ?IDENT?Solver(problem);
       solver.Start();
     }
+    private static void ParseArguments(string[] args) {
+      var maxDepthRegex = new Regex(@""--maxDepth=(?<d>.+)"");
+
+      var helpRegex = new Regex(@""--help|/\?"");
+      
+      foreach(var arg in args) {
+        var maxDepthMatch = maxDepthRegex.Match(arg);
+        var helpMatch = helpRegex.Match(arg);
+        if(helpMatch.Success) { 
+          PrintUsage(); Environment.Exit(0);
+        } else if(maxDepthMatch.Success) {
+           maxDepth = int.Parse(maxDepthMatch.Groups[""d""].Captures[0].Value, System.Globalization.CultureInfo.InvariantCulture);
+           if(maxDepth < 1 || maxDepth > 100) throw new ArgumentException(""max depth must lie in range [1 ... 100]"");
+        } else {
+           Console.WriteLine(""Unknown switch {0}"", arg); PrintUsage(); Environment.Exit(0); 
+        }
+      }
+    }
+    private static void PrintUsage() {
+      Console.WriteLine(""Find a solution using brute force tree search."");
+      Console.WriteLine();
+      Console.WriteLine(""Parameters:"");
+      Console.WriteLine(""\t--maxDepth=<depth>\tSets the maximal depth of sampled trees [Default: 20]"");
+      Console.WriteLine(""\t--help\tPrints this help text."");
+    }
+
 
     public ?IDENT?Solver(?IDENT?Problem problem) {
@@ -84,5 +112,4 @@
 
     private void Start() {
-      const int MAX_SECONDS = 100000;
       var bestF = ?MAXIMIZATION? ? double.NegativeInfinity : double.PositiveInfinity;
       int n = 0;
@@ -90,12 +117,11 @@
       long sumSize = 0;
       var sumF = 0.0;
-      var terminationTimer = new Stopwatch();
       var sw = new System.Diagnostics.Stopwatch();
       sw.Start();
-      terminationTimer.Start();
-      for(int depth = 1; terminationTimer.Elapsed.TotalSeconds < MAX_SECONDS; depth ++) {
+      for(int depth = 1; depth < maxDepth; depth ++) {
         Console.WriteLine(""Depth {0}:"", depth);
         foreach(var t in GenerateTrees(0, depth)) {
           var f = problem.Evaluate(t);
+          // t.PrintTree(0); Console.WriteLine();
           var size = t.GetSize();
           sumSize += size;
@@ -104,5 +130,4 @@
           sumF += f;
           if (problem.IsBetter(f, bestF)) {
-            t.PrintTree(0); Console.WriteLine();
             bestF = f;
             t.PrintTree(0); Console.WriteLine();
@@ -111,11 +136,10 @@
           if (n % 1000 == 0) {
             sw.Stop();
-            Console.WriteLine(""{6,5:0.0s}: {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, terminationTimer.Elapsed.TotalSeconds);
+            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);
             sumSize = 0;
             sumDepth = 0;
             sumF = 0.0;
             sw.Restart();
-            if(terminationTimer.Elapsed.TotalSeconds >= MAX_SECONDS) break;
           }
         }
Index: branches/HeuristicLab.Problems.GPDL/CodeGenerator/ProblemCodeGen.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/CodeGenerator/ProblemCodeGen.cs	(revision 10424)
+++ branches/HeuristicLab.Problems.GPDL/CodeGenerator/ProblemCodeGen.cs	(revision 10425)
@@ -153,8 +153,8 @@
     private void GenerateSolvers(GPDefNode ast, SourceBuilder solverSourceCode) {
       var grammar = CreateGrammarFromAst(ast);
-      var randomSearchCodeGen = new RandomSearchCodeGen();
-      randomSearchCodeGen.Generate(grammar, ast.Terminals.OfType<TerminalNode>(), ast.FitnessFunctionNode.Maximization, solverSourceCode);
-      // var bruteForceSearchCodeGen = new BruteForceCodeGen();
-      // bruteForceSearchCodeGen.Generate(grammar, ast.Terminals.OfType<TerminalNode>(), ast.FitnessFunctionNode.Maximization, solverSourceCode);
+      // var randomSearchCodeGen = new RandomSearchCodeGen();
+      // randomSearchCodeGen.Generate(grammar, ast.Terminals.OfType<TerminalNode>(), ast.FitnessFunctionNode.Maximization, solverSourceCode);
+      var bruteForceSearchCodeGen = new BruteForceCodeGen();
+      bruteForceSearchCodeGen.Generate(grammar, ast.Terminals.OfType<TerminalNode>(), ast.FitnessFunctionNode.Maximization, solverSourceCode);
       // var mctsCodeGen = new MonteCarloTreeSearchCodeGen();
       // mctsCodeGen.Generate(grammar, ast.Terminals.OfType<TerminalNode>(), ast.FitnessFunctionNode.Maximization, solverSourceCode);
