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 | Public Attributes | List of all members
agent.tests.test_epsilon_greedy.TestEpsilonGreedy Class Reference

Test case to verify behavior of the epsilon greedy agent implementation. More...

Inheritance diagram for agent.tests.test_epsilon_greedy.TestEpsilonGreedy:

Public Member Functions

None setUp (self)
 Create an agent to use for tests.
 
 test_action_selection (self)
 Test appropriate actions are selected.
 
 test_epsilon_bounds (self)
 Test that epsilon only accepts probability values.
 
 test_update (self)
 Test that the update works correctly.
 

Public Attributes

 agent
 

Detailed Description

Test case to verify behavior of the epsilon greedy agent implementation.

Definition at line 6 of file test_epsilon_greedy.py.

Member Function Documentation

◆ setUp()

None agent.tests.test_epsilon_greedy.TestEpsilonGreedy.setUp (   self)

Create an agent to use for tests.

Definition at line 11 of file test_epsilon_greedy.py.

◆ test_action_selection()

agent.tests.test_epsilon_greedy.TestEpsilonGreedy.test_action_selection (   self)

Test appropriate actions are selected.

As the agent can select via explore or exploit, no specific action is assumed. So this just tests that all selected actions are within the correct range of [0, k).

Definition at line 17 of file test_epsilon_greedy.py.

◆ test_epsilon_bounds()

agent.tests.test_epsilon_greedy.TestEpsilonGreedy.test_epsilon_bounds (   self)

Test that epsilon only accepts probability values.

Definition at line 30 of file test_epsilon_greedy.py.

◆ test_update()

agent.tests.test_epsilon_greedy.TestEpsilonGreedy.test_update (   self)

Test that the update works correctly.

The agent uses a weighted average, so use known values to ensure correct calculation.

Definition at line 44 of file test_epsilon_greedy.py.

Member Data Documentation

◆ agent

agent.tests.test_epsilon_greedy.TestEpsilonGreedy.agent

Definition at line 15 of file test_epsilon_greedy.py.


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