AIToolbox
A library that offers tools for AI problem solving.
|
This class represents an epsilon-greedy policy for Factored MDPs. More...
#include <AIToolbox/Factored/MDP/Policies/EpsilonPolicy.hpp>
Public Types | |
using | EpsilonBase = EpsilonPolicyInterface< State, State, Action > |
Public Types inherited from AIToolbox::EpsilonPolicyInterface< State, State, Action > | |
using | Base = PolicyInterface< State, State, Action > |
Public Member Functions | |
EpsilonPolicy (const EpsilonBase::Base &p, double epsilon=0.1) | |
Basic constructor. More... | |
Public Member Functions inherited from AIToolbox::EpsilonPolicyInterface< State, State, Action > | |
EpsilonPolicyInterface (const Base &p, double epsilon=0.1) | |
Basic constructor. More... | |
virtual Action | sampleAction (const State &s) const override |
This function chooses an action for state s, following the policy distribution and epsilon. More... | |
virtual double | getActionProbability (const State &s, const Action &a) const override |
This function returns the probability of taking the specified action in the specified state. 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... | |
Public Member Functions inherited from AIToolbox::PolicyInterface< State, State, Action > | |
PolicyInterface (State s, Action a) | |
Basic constructor. More... | |
virtual | ~PolicyInterface () |
Basic virtual destructor. More... | |
const State & | getS () const |
This function returns the number of states of the world. More... | |
const Action & | getA () const |
This function returns the number of available actions to the agent. More... | |
Protected Member Functions | |
virtual Action | sampleRandomAction () const |
This function returns a random action in the Action space. More... | |
virtual double | getRandomActionProbability () const |
This function returns the probability of picking a random action. More... | |
Protected Member Functions inherited from AIToolbox::EpsilonPolicyInterface< State, State, Action > | |
virtual Action | sampleRandomAction () const=0 |
This function returns a random action in the Action space. More... | |
virtual double | getRandomActionProbability () const=0 |
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::EpsilonPolicyInterface< State, State, Action > | |
const Base & | policy_ |
double | epsilon_ |
Protected Attributes inherited from AIToolbox::PolicyInterface< State, State, Action > | |
State | S |
Action | A |
RandomEngine | rand_ |
This class represents an epsilon-greedy policy for Factored MDPs.
using AIToolbox::Factored::MDP::EpsilonPolicy::EpsilonBase = EpsilonPolicyInterface<State, State, Action> |
AIToolbox::Factored::MDP::EpsilonPolicy::EpsilonPolicy | ( | const EpsilonBase::Base & | 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. |
|
protectedvirtual |
This function returns the probability of picking a random action.
|
protectedvirtual |
This function returns a random action in the Action space.
|
mutableprotected |