Changeset 11747 for branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/BanditPolicies/ModelPolicyActionInfo.cs
- Timestamp:
- 01/12/15 21:23:01 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/BanditPolicies/ModelPolicyActionInfo.cs
r11744 r11747 10 10 public class ModelPolicyActionInfo : IBanditPolicyActionInfo { 11 11 private readonly IModel model; 12 private double knownValue; 12 13 public bool Disabled { get { return Tries == -1; } } 13 public double Value { get { return model.SampleExpectedReward(new Random()); } } 14 public double Value { 15 get { 16 if (Disabled) return knownValue; 17 else 18 return model.SampleExpectedReward(new Random()); 19 } 20 } 14 21 15 22 public int Tries { get; private set; } … … 28 35 } 29 36 30 public void Disable( ) {37 public void Disable(double reward) { 31 38 this.Tries = -1; 39 this.knownValue = reward; 32 40 } 33 41 34 42 public void Reset() { 35 43 Tries = 0; 44 knownValue = 0.0; 36 45 model.Reset(); 37 46 }
Note: See TracChangeset
for help on using the changeset viewer.