|
AIToolbox
A library that offers tools for AI problem solving.
|
#include <AIToolbox/Factored/Bandit/Policies/EpsilonPolicy.hpp>
Public Types | |
| using | EpsilonBase = EpsilonPolicyInterface< void, void, Action > |
Public Types inherited from AIToolbox::Factored::Bandit::PolicyInterface | |
| using | Base = AIToolbox::PolicyInterface< void, void, Action > |
Public Types inherited from AIToolbox::EpsilonPolicyInterface< void, void, Action > | |
| using | Base = PolicyInterface< void, void, Action > |
Public Member Functions | |
| EpsilonPolicy (const PolicyInterface &p, double epsilon=0.1) | |
| Basic constructor. More... | |
Public Member Functions inherited from AIToolbox::PolicyInterface< void, void, Action > | |
| PolicyInterface (Action a) | |
| Basic constructor. More... | |
| virtual | ~PolicyInterface () |
| Basic virtual destructor. More... | |
| const Action & | getA () const |
| This function returns the number of available actions to the agent. More... | |
Public Member Functions inherited from AIToolbox::EpsilonPolicyInterface< void, void, Action > | |
| EpsilonPolicyInterface (const Base &p, double epsilon=0.1) | |
| Basic constructor. More... | |
| virtual Action | sampleAction () const override |
| This function chooses an action, following the policy distribution and epsilon. More... | |
| virtual double | getActionProbability (const Action &a) const override |
| This function returns the probability of taking the specified action. More... | |
| void | setEpsilon (double e) |
| This function sets the epsilon parameter. More... | |
| double | getEpsilon () const |
| This function will return the currently set epsilon parameter. More... | |
Protected Member Functions | |
| virtual Action | sampleRandomAction () const override |
| This function returns a random action in the Action space. More... | |
| virtual double | getRandomActionProbability () const override |
| This function returns the probability of picking a random action. More... | |
Protected Attributes | |
| std::vector< std::uniform_int_distribution< size_t > > | randomDistribution_ |
Protected Attributes inherited from AIToolbox::PolicyInterface< void, void, Action > | |
| Action | A |
| RandomEngine | rand_ |
Protected Attributes inherited from AIToolbox::EpsilonPolicyInterface< void, void, Action > | |
| const Base & | policy_ |
| double | epsilon_ |
| using AIToolbox::Factored::Bandit::EpsilonPolicy::EpsilonBase = EpsilonPolicyInterface<void, void, Action> |
| AIToolbox::Factored::Bandit::EpsilonPolicy::EpsilonPolicy | ( | const PolicyInterface & | p, |
| double | epsilon = 0.1 |
||
| ) |
Basic constructor.
This constructor saves the input policy and the epsilon parameter for later use.
The epsilon parameter must be >= 0.0 and <= 1.0, otherwise the constructor will throw an std::invalid_argument.
| p | The policy that is being extended. |
| epsilon | The parameter that controls the amount of exploration. |
|
overrideprotectedvirtual |
This function returns the probability of picking a random action.
Implements AIToolbox::EpsilonPolicyInterface< void, void, Action >.
|
overrideprotectedvirtual |
This function returns a random action in the Action space.
Implements AIToolbox::EpsilonPolicyInterface< void, void, Action >.
|
mutableprotected |