k-Armed Bandit 1.0.0
A collection of k-armed bandits and assoicated agents for reinforcement learning
Loading...
Searching...
No Matches
Public Member Functions | List of all members
bandit.tests.test_base_bandit.FakeBandit Class Reference

This is a fake child class. More...

Inheritance diagram for bandit.tests.test_base_bandit.FakeBandit:
bandit.base_bandit.BaseBandit

Public Member Functions

 __init__ (self, k)
 Initialize the object with a set number of arms.
 
 select (self, index)
 The method to select one of the arms of the bandit.
 
 trueValues (self)
 Return the true reward values of the bandit.
 
- Public Member Functions inherited from bandit.base_bandit.BaseBandit
int k (self)
 Return the number of arms this bandit has.
 

Additional Inherited Members

- Protected Attributes inherited from bandit.base_bandit.BaseBandit
 _k
 

Detailed Description

This is a fake child class.

Since Bandit is an abstract class, it can't be instantiated directly. So it's methods can't be called, and therefore tested. So create a fake class that defines the required methods in the simplist terms and use that instead.

Definition at line 5 of file test_base_bandit.py.

Constructor & Destructor Documentation

◆ __init__()

bandit.tests.test_base_bandit.FakeBandit.__init__ (   self,
  k 
)

Initialize the object with a set number of arms.

Parameters
kThe number of arms this bandit should have. This must be an integer greater than zero.
Exceptions
ValueErrorif k is not an integer greater than zero.

Reimplemented from bandit.base_bandit.BaseBandit.

Definition at line 15 of file test_base_bandit.py.

Member Function Documentation

◆ select()

bandit.tests.test_base_bandit.FakeBandit.select (   self,
  index 
)

The method to select one of the arms of the bandit.

When implemented, this method should return the reward obtained when selecting the given arm index.

Parameters
indexSome sort of index representation to select which arms to get rewards from. Typically, this will be a single integer or some sort of list, array, etc. of integers.

Reimplemented from bandit.base_bandit.BaseBandit.

Definition at line 18 of file test_base_bandit.py.

◆ trueValues()

bandit.tests.test_base_bandit.FakeBandit.trueValues (   self)

Return the true reward values of the bandit.

When implemented, this should provide the user with the complete truth of the bandit's state at the moment called. It is up to the implementation what exact information this is.

Reimplemented from bandit.base_bandit.BaseBandit.

Definition at line 21 of file test_base_bandit.py.


The documentation for this class was generated from the following file: