Free cookie consent management tool by TermsFeed Policy Generator

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

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

#2283: solution reorganization

File size: 884 bytes
RevLine 
[11732]1using System;
2using System.Collections.Generic;
3using System.Diagnostics;
4using System.Linq;
5using System.Text;
6using System.Threading.Tasks;
7
[11742]8namespace HeuristicLab.Algorithms.Bandits.BanditPolicies {
9  public class MeanAndVariancePolicyActionInfo : IBanditPolicyActionInfo {
[11732]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; } }
[11747]15    public double Value {
16      get {
[11832]17        return AvgReward;
[11747]18      }
19    }
[11732]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.