32#include "Parameters.hpp"
34#include <boost/random/mersenne_twister.hpp>
35#include <boost/random/bernoulli_distribution.hpp>
36#include <boost/random/uniform_int_distribution.hpp>
62 boost::random::bernoulli_distribution<> p;
63 boost::random::uniform_int_distribution<> p2;
70 bool alpha_is_1_over_n;
87 ERWA(
size_t,
bool=
true,
bool=
true);
89 inline size_t get_choice()
const {
97 boost::random::bernoulli_distribution<> new_p(_e);
115 friend ostream& operator<<(ostream&,
const ERWA&);
Implementation of the ERWA algorithm for multiarmed bandits.
static boost::random::mt19937 random_generator
Random source.
size_t choice
Store the last choice made.
size_t choose()
Choose using the current state.
bool choose_next
Belt-and braces: warn if choose/reward happens in the wrong order.
size_t find_max() const
Find the index of the currently maximum r_hat.
void reward(double)
Provide reward for the most recent choice.
void set_alpha(double _a)
Reset alpha to something different.
void set_epsilon(double _e)
Reset epsilon to something different.