using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; using HeuristicLab.Common; namespace HeuristicLab.Algorithms.Bandits.Models { public class GammaModel : IModel { private readonly double a; private readonly double b; public GammaModel(double a = 1.0, double b = 1.0) { this.a = a; this.b = b; } public double Sample(Random random) { return Rand.GammaRand(random, a) * b; } public void Update(double reward) { throw new NotSupportedException(); } public void Reset() { throw new NotSupportedException(); } public object Clone() { return new GammaModel(a, b); } public override string ToString() { return string.Format("Gamma({0:F2},{1:F2})", a, b); } } }