Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization-gkr/HeuristicLab.Algorithms.Bandits/Policies/SingleArmPolicy.cs @ 13728

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

#2283: experiments on grammatical optimization algorithms (maxreward instead of avg reward, ...)

File size: 755 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Diagnostics;
4using System.Linq;
5using System.Text;
6using System.Threading.Tasks;
7using HeuristicLab.Common;
8
9namespace HeuristicLab.Algorithms.Bandits.BanditPolicies {
10  public class SingleArmPolicy : IBanditPolicy {
11    public int Arm { get; private set; }
12
13    public SingleArmPolicy(int arm) {
14      this.Arm = arm;
15    }
16
17    public override string ToString() {
18      return string.Format("SingleArmPolicy({0})", Arm);
19    }
20
21    public int SelectAction(Random random, IEnumerable<IBanditPolicyActionInfo> actionInfos) {
22      return Arm;
23    }
24
25    public IBanditPolicyActionInfo CreateActionInfo() {
26      return new DefaultPolicyActionInfo();
27    }
28  }
29}
Note: See TracBrowser for help on using the repository browser.