k-Armed Bandit 1.0.0
A collection of k-armed bandits and assoicated agents for reinforcement learning
|
This is a fake child class. More...
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 | |
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.
bandit.tests.test_base_bandit.FakeBandit.__init__ | ( | self, | |
k | |||
) |
Initialize the object with a set number of arms.
k | The number of arms this bandit should have. This must be an integer greater than zero. |
ValueError | if k is not an integer greater than zero. |
Reimplemented from bandit.base_bandit.BaseBandit.
Definition at line 15 of file test_base_bandit.py.
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.
index | Some 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.
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.