Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/02/15 16:08:21 (9 years ago)
Author:
gkronber
Message:

#2283: several major extensions for grammatical optimization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Bandits/BernoulliBandit.cs

    r11711 r11730  
    66
    77namespace HeuristicLab.Algorithms.Bandits {
    8   public class BernoulliBandit {
     8  public class BernoulliBandit : IBandit {
    99    public int NumArms { get; private set; }
    1010    public double OptimalExpectedReward { get; private set; } // reward of the best arm, for calculating regret
     11    public int OptimalExpectedRewardArm { get; private set; }
     12    // the arm with highest expected reward also has the highest probability of return a reward of 1.0
     13    public int OptimalMaximalRewardArm { get { return OptimalExpectedRewardArm; } }
     14
    1115    private readonly Random random;
    1216    private readonly double[] expReward;
     
    1923      for (int i = 0; i < nArms; i++) {
    2024        expReward[i] = random.NextDouble();
    21         if (expReward[i] > OptimalExpectedReward) OptimalExpectedReward = expReward[i];
     25        if (expReward[i] > OptimalExpectedReward) {
     26          OptimalExpectedReward = expReward[i];
     27          OptimalExpectedRewardArm = i;
     28        }
    2229      }
    2330    }
Note: See TracChangeset for help on using the changeset viewer.