Index: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/BanditPolicy.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/BanditPolicy.cs	(revision 11710)
+++ 	(revision )
@@ -1,18 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace HeuristicLab.Algorithms.Bandits {
-  public abstract class BanditPolicy : IPolicy {
-    public int NumActions { get; private set; }
-    public BanditPolicy(int numActions) {
-      this.NumActions = numActions;
-    }
-
-    public abstract int SelectAction();
-    public abstract void UpdateReward(int action, double reward);
-    public abstract void Reset();
-  }
-}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Bandits/BernoulliBandit.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Bandits/BernoulliBandit.cs	(revision 11711)
+++ branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Bandits/BernoulliBandit.cs	(revision 11711)
@@ -0,0 +1,31 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.Bandits {
+  public class BernoulliBandit {
+    public int NumArms { get; private set; }
+    public double OptimalExpectedReward { get; private set; } // reward of the best arm, for calculating regret
+    private readonly Random random;
+    private readonly double[] expReward;
+    public BernoulliBandit(Random random, int nArms) {
+      this.random = random;
+      this.NumArms = nArms;
+      // expected reward of arms is iid and uniformly distributed 
+      expReward = new double[nArms];
+      OptimalExpectedReward = double.NegativeInfinity;
+      for (int i = 0; i < nArms; i++) {
+        expReward[i] = random.NextDouble();
+        if (expReward[i] > OptimalExpectedReward) OptimalExpectedReward = expReward[i];
+      }
+    }
+
+    // pulling an arm results in a bernoulli distributed reward 
+    // with mean expReward[i]
+    public double Pull(int arm) {
+      return random.NextDouble() <= expReward[arm] ? 1 : 0;
+    }
+  }
+}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Bandits/TruncatedNormalBandit.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Bandits/TruncatedNormalBandit.cs	(revision 11711)
+++ branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Bandits/TruncatedNormalBandit.cs	(revision 11711)
@@ -0,0 +1,42 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.Bandits {
+  public class TruncatedNormalBandit {
+    public int NumArms { get; private set; }
+    public double OptimalExpectedReward { get; private set; } // reward of the best arm, for calculating regret
+    private readonly Random random;
+    private readonly double[] expReward;
+    public TruncatedNormalBandit(Random random, int nArms) {
+      this.random = random;
+      this.NumArms = nArms;
+      // expected reward of arms is iid and uniformly distributed 
+      expReward = new double[nArms];
+      OptimalExpectedReward = double.NegativeInfinity;
+      for (int i = 0; i < nArms; i++) {
+        expReward[i] = random.NextDouble();
+        if (expReward[i] > OptimalExpectedReward) OptimalExpectedReward = expReward[i];
+      }
+    }
+
+    // pulling an arm results in a truncated normally distributed reward 
+    // with mean expReward[i] and std.dev 0.1
+    public double Pull(int arm) {
+      double x = 0;
+      do {
+        var z = Transform(random.NextDouble(), random.NextDouble());
+        x = z * 0.1 + expReward[arm];
+      }
+      while (x < 0 || x > 1);
+      return x;
+    }
+
+    // box muller transform
+    private double Transform(double u1, double u2) {
+      return Math.Sqrt(-2 * Math.Log(u1)) * Math.Cos(2 * Math.PI * u2);
+    }
+  }
+}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/BernoulliBandit.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/BernoulliBandit.cs	(revision 11710)
+++ 	(revision )
@@ -1,31 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace HeuristicLab.Algorithms.Bandits {
-  public class BernoulliBandit {
-    public int NumArms { get; private set; }
-    public double OptimalExpectedReward { get; private set; } // reward of the best arm, for calculating regret
-    private readonly Random random;
-    private readonly double[] expReward;
-    public BernoulliBandit(Random random, int nArms) {
-      this.random = random;
-      this.NumArms = nArms;
-      // expected reward of arms is iid and uniformly distributed 
-      expReward = new double[nArms];
-      OptimalExpectedReward = double.NegativeInfinity;
-      for (int i = 0; i < nArms; i++) {
-        expReward[i] = random.NextDouble();
-        if (expReward[i] > OptimalExpectedReward) OptimalExpectedReward = expReward[i];
-      }
-    }
-
-    // pulling an arm results in a bernoulli distributed reward 
-    // with mean expReward[i]
-    public double Pull(int arm) {
-      return random.NextDouble() <= expReward[arm] ? 1 : 0;
-    }
-  }
-}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/EpsGreedyPolicy.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/EpsGreedyPolicy.cs	(revision 11710)
+++ 	(revision )
@@ -1,49 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace HeuristicLab.Algorithms.Bandits {
-  public class EpsGreedyPolicy : BanditPolicy {
-    private readonly Random random;
-    private readonly double eps;
-    private readonly int[] tries;
-    private readonly double[] sumReward;
-    public EpsGreedyPolicy(Random random, int numActions, double eps)
-      : base(numActions) {
-      this.random = random;
-      this.eps = eps;
-      this.tries = new int[NumActions];
-      this.sumReward = new double[NumActions];
-    }
-
-    public override int SelectAction() {
-      if (random.NextDouble() > eps) {
-        // select best
-        var maxReward = double.NegativeInfinity;
-        int bestAction = -1;
-        for (int i = 0; i < NumActions; i++) {
-          if (tries[i] == 0) return i;
-          var avgReward = sumReward[i] / tries[i];
-          if (maxReward < avgReward) {
-            maxReward = avgReward;
-            bestAction = i;
-          }
-        }
-        return bestAction;
-      } else {
-        // select random
-        return random.Next(NumActions);
-      }
-    }
-    public override void UpdateReward(int action, double reward) {
-      tries[action]++;
-      sumReward[action] += reward;
-    }
-    public override void Reset() {
-      Array.Clear(tries, 0, tries.Length);
-      Array.Clear(sumReward, 0, sumReward.Length);
-    }
-  }
-}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/HeuristicLab.Algorithms.Bandits.csproj
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/HeuristicLab.Algorithms.Bandits.csproj	(revision 11710)
+++ branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/HeuristicLab.Algorithms.Bandits.csproj	(revision 11711)
@@ -40,19 +40,16 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="BernoulliBandit.cs" />
-    <Compile Include="BanditPolicy.cs" />
-    <Compile Include="TruncatedNormalBandit.cs" />
-    <Compile Include="UCBNormalPolicy.cs" />
-    <Compile Include="UCB1TunedPolicy.cs" />
-    <Compile Include="UCB1Policy.cs" />
-    <Compile Include="EpsGreedyPolicy.cs" />
+    <Compile Include="Bandits\BernoulliBandit.cs" />
+    <Compile Include="Bandits\TruncatedNormalBandit.cs" />
+    <Compile Include="Policies\BanditPolicy.cs" />
+    <Compile Include="Policies\EpsGreedyPolicy.cs" />
+    <Compile Include="Policies\RandomPolicy.cs" />
+    <Compile Include="Policies\UCB1Policy.cs" />
+    <Compile Include="Policies\UCB1TunedPolicy.cs" />
+    <Compile Include="Policies\UCBNormalPolicy.cs" />
     <Compile Include="IPolicy.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="RandomPolicy.cs" />
   </ItemGroup>
-  <ItemGroup>
-    <Folder Include="Bandits\" />
-    <Folder Include="Policies\" />
-  </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/BanditPolicy.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/BanditPolicy.cs	(revision 11711)
+++ branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/BanditPolicy.cs	(revision 11711)
@@ -0,0 +1,18 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.Bandits {
+  public abstract class BanditPolicy : IPolicy {
+    public int NumActions { get; private set; }
+    public BanditPolicy(int numActions) {
+      this.NumActions = numActions;
+    }
+
+    public abstract int SelectAction();
+    public abstract void UpdateReward(int action, double reward);
+    public abstract void Reset();
+  }
+}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/EpsGreedyPolicy.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/EpsGreedyPolicy.cs	(revision 11711)
+++ branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/EpsGreedyPolicy.cs	(revision 11711)
@@ -0,0 +1,49 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.Bandits {
+  public class EpsGreedyPolicy : BanditPolicy {
+    private readonly Random random;
+    private readonly double eps;
+    private readonly int[] tries;
+    private readonly double[] sumReward;
+    public EpsGreedyPolicy(Random random, int numActions, double eps)
+      : base(numActions) {
+      this.random = random;
+      this.eps = eps;
+      this.tries = new int[NumActions];
+      this.sumReward = new double[NumActions];
+    }
+
+    public override int SelectAction() {
+      if (random.NextDouble() > eps) {
+        // select best
+        var maxReward = double.NegativeInfinity;
+        int bestAction = -1;
+        for (int i = 0; i < NumActions; i++) {
+          if (tries[i] == 0) return i;
+          var avgReward = sumReward[i] / tries[i];
+          if (maxReward < avgReward) {
+            maxReward = avgReward;
+            bestAction = i;
+          }
+        }
+        return bestAction;
+      } else {
+        // select random
+        return random.Next(NumActions);
+      }
+    }
+    public override void UpdateReward(int action, double reward) {
+      tries[action]++;
+      sumReward[action] += reward;
+    }
+    public override void Reset() {
+      Array.Clear(tries, 0, tries.Length);
+      Array.Clear(sumReward, 0, sumReward.Length);
+    }
+  }
+}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/RandomPolicy.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/RandomPolicy.cs	(revision 11711)
+++ branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/RandomPolicy.cs	(revision 11711)
@@ -0,0 +1,25 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.Bandits {
+  public class RandomPolicy : BanditPolicy {
+    private readonly Random random;
+    public RandomPolicy(Random random, int numActions)
+      : base(numActions) {
+      this.random = random;
+    }
+
+    public override int SelectAction() {
+      return random.Next(NumActions);
+    }
+    public override void UpdateReward(int action, double reward) {
+      // do nothing
+    }
+    public override void Reset() {
+      // do nothing
+    }
+  }
+}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/UCB1Policy.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/UCB1Policy.cs	(revision 11711)
+++ branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/UCB1Policy.cs	(revision 11711)
@@ -0,0 +1,42 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.Bandits {
+  public class UCB1Policy : BanditPolicy {
+    private readonly int[] tries;
+    private readonly double[] sumReward;
+    private int totalTries = 0;
+    public UCB1Policy(int numActions)
+      : base(numActions) {
+      this.tries = new int[NumActions];
+      this.sumReward = new double[NumActions];
+    }
+
+    public override int SelectAction() {
+      int bestAction = -1;
+      double bestQ = double.NegativeInfinity;
+      for (int i = 0; i < NumActions; i++) {
+        if (tries[i] == 0) return i;
+        var q = sumReward[i] / tries[i] + Math.Sqrt((2 * Math.Log(totalTries)) / tries[i]);
+        if (q > bestQ) {
+          bestQ = q;
+          bestAction = i;
+        }
+      }
+      return bestAction;
+    }
+    public override void UpdateReward(int action, double reward) {
+      totalTries++;
+      tries[action]++;
+      sumReward[action] += reward;
+    }
+    public override void Reset() {
+      totalTries = 0;
+      Array.Clear(tries, 0, tries.Length);
+      Array.Clear(sumReward, 0, sumReward.Length);
+    }
+  }
+}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/UCB1TunedPolicy.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/UCB1TunedPolicy.cs	(revision 11711)
+++ branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/UCB1TunedPolicy.cs	(revision 11711)
@@ -0,0 +1,52 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.Bandits {
+  public class UCB1TunedPolicy : BanditPolicy {
+    private readonly int[] tries;
+    private readonly double[] sumReward;
+    private readonly double[] sumSqrReward;
+    private int totalTries = 0;
+    public UCB1TunedPolicy(int numActions)
+      : base(numActions) {
+      this.tries = new int[NumActions];
+      this.sumReward = new double[NumActions];
+      this.sumSqrReward = new double[NumActions];
+    }
+
+    private double V(int arm) {
+      var s = tries[arm];
+      return sumSqrReward[arm] / s - Math.Pow(sumReward[arm] / s, 2) + Math.Sqrt(2 * Math.Log(totalTries) / s);
+    }
+
+
+    public override int SelectAction() {
+      int bestAction = -1;
+      double bestQ = double.NegativeInfinity;
+      for (int i = 0; i < NumActions; i++) {
+        if (tries[i] == 0) return i;
+        var q = sumReward[i] / tries[i] + Math.Sqrt((Math.Log(totalTries) / tries[i]) * Math.Min(1.0 / 4, V(i))); // 1/4 is upper bound of bernoulli distributed variable
+        if (q > bestQ) {
+          bestQ = q;
+          bestAction = i;
+        }
+      }
+      return bestAction;
+    }
+    public override void UpdateReward(int action, double reward) {
+      totalTries++;
+      tries[action]++;
+      sumReward[action] += reward;
+      sumSqrReward[action] += reward * reward;
+    }
+    public override void Reset() {
+      totalTries = 0;
+      Array.Clear(tries, 0, tries.Length);
+      Array.Clear(sumReward, 0, sumReward.Length);
+      Array.Clear(sumSqrReward, 0, sumSqrReward.Length);
+    }
+  }
+}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/UCBNormalPolicy.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/UCBNormalPolicy.cs	(revision 11711)
+++ branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/UCBNormalPolicy.cs	(revision 11711)
@@ -0,0 +1,54 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.Bandits {
+  public class UCBNormalPolicy : BanditPolicy {
+    private readonly int[] tries;
+    private readonly double[] sumReward;
+    private readonly double[] sumSqrReward;
+    private int totalTries = 0;
+    public UCBNormalPolicy(int numActions)
+      : base(numActions) {
+      this.tries = new int[NumActions];
+      this.sumReward = new double[NumActions];
+      this.sumSqrReward = new double[NumActions];
+    }
+
+    private double V(int arm) {
+      var s = tries[arm];
+      return sumSqrReward[arm] / s - Math.Pow(sumReward[arm] / s, 2) + Math.Sqrt(2 * Math.Log(totalTries) / s);
+    }
+
+
+    public override int SelectAction() {
+      int bestAction = -1;
+      double bestQ = double.NegativeInfinity;
+      for (int i = 0; i < NumActions; i++) {
+        if (totalTries == 0 || tries[i] == 0 || tries[i] < Math.Ceiling(8 * Math.Log(totalTries))) return i;
+        var avgReward = sumReward[i] / tries[i];
+        var q = avgReward
+          + Math.Sqrt(16 * ((sumSqrReward[i] - tries[i] * Math.Pow(avgReward, 2)) / (tries[i] - 1)) * (Math.Log(totalTries - 1) / tries[i]));
+        if (q > bestQ) {
+          bestQ = q;
+          bestAction = i;
+        }
+      }
+      return bestAction;
+    }
+    public override void UpdateReward(int action, double reward) {
+      totalTries++;
+      tries[action]++;
+      sumReward[action] += reward;
+      sumSqrReward[action] += reward * reward;
+    }
+    public override void Reset() {
+      totalTries = 0;
+      Array.Clear(tries, 0, tries.Length);
+      Array.Clear(sumReward, 0, sumReward.Length);
+      Array.Clear(sumSqrReward, 0, sumSqrReward.Length);
+    }
+  }
+}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/RandomPolicy.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/RandomPolicy.cs	(revision 11710)
+++ 	(revision )
@@ -1,25 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace HeuristicLab.Algorithms.Bandits {
-  public class RandomPolicy : BanditPolicy {
-    private readonly Random random;
-    public RandomPolicy(Random random, int numActions)
-      : base(numActions) {
-      this.random = random;
-    }
-
-    public override int SelectAction() {
-      return random.Next(NumActions);
-    }
-    public override void UpdateReward(int action, double reward) {
-      // do nothing
-    }
-    public override void Reset() {
-      // do nothing
-    }
-  }
-}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/TruncatedNormalBandit.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/TruncatedNormalBandit.cs	(revision 11710)
+++ 	(revision )
@@ -1,42 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace HeuristicLab.Algorithms.Bandits {
-  public class TruncatedNormalBandit {
-    public int NumArms { get; private set; }
-    public double OptimalExpectedReward { get; private set; } // reward of the best arm, for calculating regret
-    private readonly Random random;
-    private readonly double[] expReward;
-    public TruncatedNormalBandit(Random random, int nArms) {
-      this.random = random;
-      this.NumArms = nArms;
-      // expected reward of arms is iid and uniformly distributed 
-      expReward = new double[nArms];
-      OptimalExpectedReward = double.NegativeInfinity;
-      for (int i = 0; i < nArms; i++) {
-        expReward[i] = random.NextDouble();
-        if (expReward[i] > OptimalExpectedReward) OptimalExpectedReward = expReward[i];
-      }
-    }
-
-    // pulling an arm results in a truncated normally distributed reward 
-    // with mean expReward[i] and std.dev 0.1
-    public double Pull(int arm) {
-      double x = 0;
-      do {
-        var z = Transform(random.NextDouble(), random.NextDouble());
-        x = z * 0.1 + expReward[arm];
-      }
-      while (x < 0 || x > 1);
-      return x;
-    }
-
-    // box muller transform
-    private double Transform(double u1, double u2) {
-      return Math.Sqrt(-2 * Math.Log(u1)) * Math.Cos(2 * Math.PI * u2);
-    }
-  }
-}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/UCB1Policy.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/UCB1Policy.cs	(revision 11710)
+++ 	(revision )
@@ -1,42 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace HeuristicLab.Algorithms.Bandits {
-  public class UCB1Policy : BanditPolicy {
-    private readonly int[] tries;
-    private readonly double[] sumReward;
-    private int totalTries = 0;
-    public UCB1Policy(int numActions)
-      : base(numActions) {
-      this.tries = new int[NumActions];
-      this.sumReward = new double[NumActions];
-    }
-
-    public override int SelectAction() {
-      int bestAction = -1;
-      double bestQ = double.NegativeInfinity;
-      for (int i = 0; i < NumActions; i++) {
-        if (tries[i] == 0) return i;
-        var q = sumReward[i] / tries[i] + Math.Sqrt((2 * Math.Log(totalTries)) / tries[i]);
-        if (q > bestQ) {
-          bestQ = q;
-          bestAction = i;
-        }
-      }
-      return bestAction;
-    }
-    public override void UpdateReward(int action, double reward) {
-      totalTries++;
-      tries[action]++;
-      sumReward[action] += reward;
-    }
-    public override void Reset() {
-      totalTries = 0;
-      Array.Clear(tries, 0, tries.Length);
-      Array.Clear(sumReward, 0, sumReward.Length);
-    }
-  }
-}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/UCB1TunedPolicy.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/UCB1TunedPolicy.cs	(revision 11710)
+++ 	(revision )
@@ -1,52 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace HeuristicLab.Algorithms.Bandits {
-  public class UCB1TunedPolicy : BanditPolicy {
-    private readonly int[] tries;
-    private readonly double[] sumReward;
-    private readonly double[] sumSqrReward;
-    private int totalTries = 0;
-    public UCB1TunedPolicy(int numActions)
-      : base(numActions) {
-      this.tries = new int[NumActions];
-      this.sumReward = new double[NumActions];
-      this.sumSqrReward = new double[NumActions];
-    }
-
-    private double V(int arm) {
-      var s = tries[arm];
-      return sumSqrReward[arm] / s - Math.Pow(sumReward[arm] / s, 2) + Math.Sqrt(2 * Math.Log(totalTries) / s);
-    }
-
-
-    public override int SelectAction() {
-      int bestAction = -1;
-      double bestQ = double.NegativeInfinity;
-      for (int i = 0; i < NumActions; i++) {
-        if (tries[i] == 0) return i;
-        var q = sumReward[i] / tries[i] + Math.Sqrt((Math.Log(totalTries) / tries[i]) * Math.Min(1.0 / 4, V(i))); // 1/4 is upper bound of bernoulli distributed variable
-        if (q > bestQ) {
-          bestQ = q;
-          bestAction = i;
-        }
-      }
-      return bestAction;
-    }
-    public override void UpdateReward(int action, double reward) {
-      totalTries++;
-      tries[action]++;
-      sumReward[action] += reward;
-      sumSqrReward[action] += reward * reward;
-    }
-    public override void Reset() {
-      totalTries = 0;
-      Array.Clear(tries, 0, tries.Length);
-      Array.Clear(sumReward, 0, sumReward.Length);
-      Array.Clear(sumSqrReward, 0, sumSqrReward.Length);
-    }
-  }
-}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/UCBNormalPolicy.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/UCBNormalPolicy.cs	(revision 11710)
+++ 	(revision )
@@ -1,54 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace HeuristicLab.Algorithms.Bandits {
-  public class UCBNormalPolicy : BanditPolicy {
-    private readonly int[] tries;
-    private readonly double[] sumReward;
-    private readonly double[] sumSqrReward;
-    private int totalTries = 0;
-    public UCBNormalPolicy(int numActions)
-      : base(numActions) {
-      this.tries = new int[NumActions];
-      this.sumReward = new double[NumActions];
-      this.sumSqrReward = new double[NumActions];
-    }
-
-    private double V(int arm) {
-      var s = tries[arm];
-      return sumSqrReward[arm] / s - Math.Pow(sumReward[arm] / s, 2) + Math.Sqrt(2 * Math.Log(totalTries) / s);
-    }
-
-
-    public override int SelectAction() {
-      int bestAction = -1;
-      double bestQ = double.NegativeInfinity;
-      for (int i = 0; i < NumActions; i++) {
-        if (totalTries == 0 || tries[i] == 0 || tries[i] < Math.Ceiling(8 * Math.Log(totalTries))) return i;
-        var avgReward = sumReward[i] / tries[i];
-        var q = avgReward
-          + Math.Sqrt(16 * ((sumSqrReward[i] - tries[i] * Math.Pow(avgReward, 2)) / (tries[i] - 1)) * (Math.Log(totalTries - 1) / tries[i]));
-        if (q > bestQ) {
-          bestQ = q;
-          bestAction = i;
-        }
-      }
-      return bestAction;
-    }
-    public override void UpdateReward(int action, double reward) {
-      totalTries++;
-      tries[action]++;
-      sumReward[action] += reward;
-      sumSqrReward[action] += reward * reward;
-    }
-    public override void Reset() {
-      totalTries = 0;
-      Array.Clear(tries, 0, tries.Length);
-      Array.Clear(sumReward, 0, sumReward.Length);
-      Array.Clear(sumSqrReward, 0, sumSqrReward.Length);
-    }
-  }
-}
