Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Diagnostics;
|
---|
4 | using System.Linq;
|
---|
5 | using System.Text;
|
---|
6 | using System.Threading.Tasks;
|
---|
7 |
|
---|
8 | namespace 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.