AIToolbox
A library that offers tools for AI problem solving.
EpsilonPolicy.hpp
Go to the documentation of this file.
1 #ifndef AI_TOOLBOX_MDP_EPSILON_POLICY_HEADER_FILE
2 #define AI_TOOLBOX_MDP_EPSILON_POLICY_HEADER_FILE
3 
6 
7 namespace AIToolbox::MDP {
8  class EpsilonPolicy : public PolicyInterface, public EpsilonPolicyInterface<size_t, size_t, size_t> {
9  public:
11 
24  EpsilonPolicy(const PolicyInterface & p, double epsilon = 0.1);
25 
37  virtual Matrix2D getPolicy() const override;
38 
39  protected:
45  virtual size_t sampleRandomAction() const override;
46 
52  virtual double getRandomActionProbability() const override;
53 
54  // Used to sampled random actions
55  mutable std::uniform_int_distribution<size_t> randomDistribution_;
56  };
57 }
58 
59 #endif
PolicyInterface.hpp
AIToolbox::Matrix2D
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor|Eigen::AutoAlign > Matrix2D
Definition: Types.hpp:18
AIToolbox::MDP::EpsilonPolicy
Definition: EpsilonPolicy.hpp:8
AIToolbox::MDP
Definition: DoubleQLearning.hpp:10
AIToolbox::MDP::EpsilonPolicy::EpsilonPolicy
EpsilonPolicy(const PolicyInterface &p, double epsilon=0.1)
Basic constructor.
AIToolbox::MDP::EpsilonPolicy::getPolicy
virtual Matrix2D getPolicy() const override
This function returns a matrix containing all probabilities of the policy.
AIToolbox::EpsilonPolicyInterface
This class is a policy wrapper for epsilon action choice.
Definition: EpsilonPolicyInterface.hpp:29
AIToolbox::MDP::EpsilonPolicy::getRandomActionProbability
virtual double getRandomActionProbability() const override
This function returns the probability of picking a random action.
AIToolbox::MDP::EpsilonPolicy::randomDistribution_
std::uniform_int_distribution< size_t > randomDistribution_
Definition: EpsilonPolicy.hpp:55
AIToolbox::MDP::PolicyInterface
Simple typedef for most of MDP's policy needs.
Definition: PolicyInterface.hpp:11
AIToolbox::MDP::EpsilonPolicy::sampleRandomAction
virtual size_t sampleRandomAction() const override
This function returns a random action in the Action space.
EpsilonPolicyInterface.hpp