![]() |
Connect++ 0.4.0
A fast, readable connection prover for first-order logic.
|
Implementation of the UCB algorithm for multiarmed bandits. More...
#include <UCB.hpp>
Public Member Functions | |
size_t | get_choice () |
size_t | choose () |
Choose using the current state. | |
void | reward (double) |
Provide reward for the most recent choice. | |
Private Attributes | |
bool | choose_next |
Belt-and braces: warn if choose/reward happens in the wrong order. | |
size_t | choice |
Store the last choice made. | |
Static Private Attributes | |
static boost::random::mt19937 | random_generator |
Random source. | |
Friends | |
ostream & | operator<< (ostream &, const UCB &) |
Implementation of the UCB algorithm for multiarmed bandits.
It's easy enough to find a description of this algorithm. The implementation here is pretty much straight from my book.
size_t UCB::choose | ( | ) |
Choose using the current state.
Definition at line 42 of file UCB.cpp.
void UCB::reward | ( | double | r | ) |
|
friend |
|
private |
|
staticprivate |