Homepage Demos Overview Downloads Tutorials Reference
Credits

karmedbanditExp3 Class Reference

#include <karmedbandit.h>

List of all members.


Detailed Description

Makes decisions regarding an adversarial k-armed bandit.

Uses algorithms described in: The non-stochastic multi-armed bandit problem Auer, Cesa-Bianchi, Freund, and Schapire October 14, 2002

Definition at line 16 of file karmedbandit.h.

Public Member Functions

 karmedbanditExp3 (unsigned int k, double gammap)
 constructor, pass the number of arms

unsigned int decide ()
 returns the next choice, [0:k-1]

void reward (bool r)
 call this if you want to reward (r==true) or penalize (r==false) the previous decision

void reset ()
 resets weights

double getGamma ()
 gets gamma parameter

void setGamma (double gammap)
 sets gamma parameter

unsigned int getK ()
 gets k parameter


Protected Attributes

std::vector< double > w
 the weights

double lastp
 prob of last choice

unsigned int last
 the last choice

double g
 gamma


Constructor & Destructor Documentation

karmedbanditExp3::karmedbanditExp3 unsigned int  k,
double  gammap
[inline]
 

constructor, pass the number of arms

Definition at line 19 of file karmedbandit.h.


Member Function Documentation

unsigned int karmedbanditExp3::decide  )  [inline]
 

returns the next choice, [0:k-1]

Definition at line 24 of file karmedbandit.h.

Referenced by karmedbanditExp3_1::decide().

double karmedbanditExp3::getGamma  )  [inline]
 

gets gamma parameter

Definition at line 66 of file karmedbandit.h.

Referenced by karmedbanditExp3_1::decide().

unsigned int karmedbanditExp3::getK  )  [inline]
 

gets k parameter

Definition at line 70 of file karmedbandit.h.

Referenced by karmedbanditExp3_1::decide(), and karmedbanditExp3_1::restart().

void karmedbanditExp3::reset  )  [inline]
 

resets weights

Definition at line 61 of file karmedbandit.h.

void karmedbanditExp3::reward bool  r  )  [inline]
 

call this if you want to reward (r==true) or penalize (r==false) the previous decision

Definition at line 53 of file karmedbandit.h.

Referenced by karmedbanditExp3_1::reward().

void karmedbanditExp3::setGamma double  gammap  )  [inline]
 

sets gamma parameter

Definition at line 68 of file karmedbandit.h.

Referenced by karmedbanditExp3_1::restart().


Member Data Documentation

double karmedbanditExp3::g [protected]
 

gamma

Definition at line 75 of file karmedbandit.h.

Referenced by decide(), getGamma(), karmedbanditExp3(), reward(), and setGamma().

unsigned int karmedbanditExp3::last [protected]
 

the last choice

Definition at line 74 of file karmedbandit.h.

Referenced by decide(), karmedbanditExp3(), and reward().

double karmedbanditExp3::lastp [protected]
 

prob of last choice

Definition at line 73 of file karmedbandit.h.

Referenced by decide(), karmedbanditExp3(), and reward().

std::vector<double> karmedbanditExp3::w [protected]
 

the weights

Definition at line 72 of file karmedbandit.h.

Referenced by decide(), getK(), karmedbanditExp3(), reset(), and reward().


The documentation for this class was generated from the following file:
Tekkotsu v2.0
Generated Wed Jan 21 03:23:15 2004 by Doxygen 1.3.4