Index: branches/HeuristicLab.Problems.GrammaticalOptimization/Main/Program.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/Main/Program.cs	(revision 12050)
+++ branches/HeuristicLab.Problems.GrammaticalOptimization/Main/Program.cs	(revision 12098)
@@ -4,4 +4,6 @@
 using HeuristicLab.Algorithms.Bandits.BanditPolicies;
 using HeuristicLab.Algorithms.GrammaticalOptimization;
+using HeuristicLab.Algorithms.MonteCarloTreeSearch;
+using HeuristicLab.Algorithms.MonteCarloTreeSearch.Simulation;
 using HeuristicLab.Problems.GrammaticalOptimization;
 
@@ -18,64 +20,72 @@
 
 
-namespace Main {
-  class Program {
-    static void Main(string[] args) {
-      CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture;
+namespace Main
+{
+    class Program
+    {
+        static void Main(string[] args)
+        {
+            CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture;
 
-      RunDemo();
-    }
+            RunDemo();
+        }
 
 
-    private static void RunDemo() {
+        private static void RunDemo()
+        {
 
 
-      int maxIterations = 100000;
-      int iterations = 0;
+            int maxIterations = 100000;
+            int iterations = 0;
 
-      var globalStatistics = new SentenceSetStatistics();
-      var random = new Random();
+            var globalStatistics = new SentenceSetStatistics();
+            var random = new Random();
 
-      //var problem = new SymbolicRegressionPoly10Problem();
-      //var problem = new SantaFeAntProblem();              
-      var problem = new RoyalPairProblem();
-      //var problem = new EvenParityProblem();
-      var alg = new SequentialSearch(problem, 23, random, 0,
-       new HeuristicLab.Algorithms.Bandits.GrammarPolicies.GenericGrammarPolicy(problem, new UCB1TunedPolicy()));
+            //var problem = new SymbolicRegressionPoly10Problem();
+            //var problem = new SantaFeAntProblem();              
+            var problem = new RoyalPairProblem();
+            //var problem = new EvenParityProblem();
+            //var alg = new SequentialSearch(problem, 23, random, 0,
+            // new HeuristicLab.Algorithms.Bandits.GrammarPolicies.GenericGrammarPolicy(problem, new UCB1TunedPolicy()));
+            var alg = new MonteCarloTreeSearch(problem, 23, random, new UCB1Policy(), new RandomSimulation(problem, random, 23));
 
 
-      alg.FoundNewBestSolution += (sentence, quality) => {
-        //Console.WriteLine("{0}", globalStatistics);
-      };
+            alg.FoundNewBestSolution += (sentence, quality) =>
+            {
+                //Console.WriteLine("{0}", globalStatistics);
+            };
 
-      alg.SolutionEvaluated += (sentence, quality) => {
-        iterations++;
-        globalStatistics.AddSentence(sentence, quality);
+            alg.SolutionEvaluated += (sentence, quality) =>
+            {
+                iterations++;
+                globalStatistics.AddSentence(sentence, quality);
 
-        // comment this if you don't want to see solver statistics
-        if (iterations % 100 == 0) {
-          if (iterations % 10000 == 0) Console.Clear();
-          Console.SetCursorPosition(0, 0);
-          alg.PrintStats();
+                // comment this if you don't want to see solver statistics
+                if (iterations % 100 == 0)
+                {
+                    if (iterations % 10000 == 0) Console.Clear();
+                    Console.SetCursorPosition(0, 0);
+                    alg.PrintStats();
+                }
+
+                // uncomment this if you want to collect statistics of the generated sentences
+                // if (iterations % 1000 == 0) {
+                //   Console.WriteLine("{0}", globalStatistics);
+                // }
+            };
+
+            var sw = new Stopwatch();
+            sw.Start();
+            alg.Run(maxIterations);
+            sw.Stop();
+
+            Console.Clear();
+            alg.PrintStats();
+            Console.WriteLine(globalStatistics);
+            Console.WriteLine("{0:F2} sec {1,10:F1} sols/sec {2,10:F1} ns/sol",
+              sw.Elapsed.TotalSeconds,
+              maxIterations / (double)sw.Elapsed.TotalSeconds,
+              (double)sw.ElapsedMilliseconds * 1000 / maxIterations);
         }
-
-        // uncomment this if you want to collect statistics of the generated sentences
-        // if (iterations % 1000 == 0) {
-        //   Console.WriteLine("{0}", globalStatistics);
-        // }
-      };
-
-      var sw = new Stopwatch();
-      sw.Start();
-      alg.Run(maxIterations);
-      sw.Stop();
-
-      Console.Clear();
-      alg.PrintStats();
-      Console.WriteLine(globalStatistics);
-      Console.WriteLine("{0:F2} sec {1,10:F1} sols/sec {2,10:F1} ns/sol",
-        sw.Elapsed.TotalSeconds,
-        maxIterations / (double)sw.Elapsed.TotalSeconds,
-        (double)sw.ElapsedMilliseconds * 1000 / maxIterations);
     }
-  }
 }
