Changeset 11742 for branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/BanditPolicies/GenericThompsonSamplingPolicy.cs
- Timestamp:
- 01/09/15 14:57:28 (10 years ago)
- Location:
- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/BanditPolicies
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/BanditPolicies/GenericThompsonSamplingPolicy.cs
r11732 r11742 7 7 using HeuristicLab.Common; 8 8 9 namespace HeuristicLab.Algorithms.Bandits {10 public class GenericThompsonSamplingPolicy : I Policy {9 namespace HeuristicLab.Algorithms.Bandits.BanditPolicies { 10 public class GenericThompsonSamplingPolicy : IBanditPolicy { 11 11 private readonly IModel model; 12 12 … … 15 15 } 16 16 17 public int SelectAction(Random random, IEnumerable<I PolicyActionInfo> actionInfos) {17 public int SelectAction(Random random, IEnumerable<IBanditPolicyActionInfo> actionInfos) { 18 18 var myActionInfos = actionInfos.OfType<ModelPolicyActionInfo>(); 19 19 int bestAction = -1; … … 34 34 } 35 35 36 public I PolicyActionInfo CreateActionInfo() {36 public IBanditPolicyActionInfo CreateActionInfo() { 37 37 return new ModelPolicyActionInfo((IModel)model.Clone()); 38 38 } 39 39 40 40 public override string ToString() { 41 return string.Format("GenericThompsonSamplingPolicy( {0})", model);41 return string.Format("GenericThompsonSamplingPolicy(\"{0}\")", model); 42 42 } 43 43 }
Note: See TracChangeset
for help on using the changeset viewer.