Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 11711 was 11711, checked in by gkronber, 9 years ago

#2283: folders for bandits and policies

File size: 632 bytes
RevLine 
[11708]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.