Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/ActionInfos/MeanAndVariancePolicyActionInfo.cs @ 13857

Last change on this file since 13857 was 11849, checked in by gkronber, 10 years ago

#2283: solution reorganization

File size: 884 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Diagnostics;
4using System.Linq;
5using System.Text;
6using System.Threading.Tasks;
7
8namespace HeuristicLab.Algorithms.Bandits.BanditPolicies {
9  public class MeanAndVariancePolicyActionInfo : IBanditPolicyActionInfo {
10    private OnlineMeanAndVarianceEstimator estimator = new OnlineMeanAndVarianceEstimator();
11    public int Tries { get { return estimator.N; } }
12    public double SumReward { get { return estimator.Sum; } }
13    public double AvgReward { get { return estimator.Avg; } }
14    public double RewardVariance { get { return estimator.Variance; } }
15    public double Value {
16      get {
17        return AvgReward;
18      }
19    }
20
21    public void UpdateReward(double reward) {
22      estimator.UpdateReward(reward);
23    }
24
25    public void Reset() {
26      estimator.Reset();
27    }
28  }
29}
Note: See TracBrowser for help on using the repository browser.