source: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/RandomPolicy.cs @ 11708

Last change on this file since 11708 was 11708, checked in by gkronber, 8 years ago

#2283: worked on bandits for grammatical optimization

File size: 632 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6
7namespace HeuristicLab.Algorithms.Bandits {
8  public class RandomPolicy : BanditPolicy {
9    private readonly Random random;
10    public RandomPolicy(Random random, int numActions)
11      : base(numActions) {
12      this.random = random;
13    }
14
15    public override int SelectAction() {
16      return random.Next(NumActions);
17    }
18    public override void UpdateReward(int action, double reward) {
19      // do nothing
20    }
21    public override void Reset() {
22      // do nothing
23    }
24  }
25}
Note: See TracBrowser for help on using the repository browser.