AIToolbox
A library that offers tools for AI problem solving.
RandomPolicy.hpp
Go to the documentation of this file.
1 #ifndef AI_TOOLBOX_BANDIT_RANDOM_POLICY_HEADER_FILE
2 #define AI_TOOLBOX_BANDIT_RANDOM_POLICY_HEADER_FILE
3 
5 
6 namespace AIToolbox::Bandit {
12  class RandomPolicy : public PolicyInterface {
13  public:
19  RandomPolicy(size_t a);
20 
26  virtual size_t sampleAction() const override;
27 
35  virtual double getActionProbability(const size_t & a) const override;
36 
48  virtual Vector getPolicy() const override;
49 
50  private:
51  // Used to sampled random actions
52  mutable std::uniform_int_distribution<size_t> randomDistribution_;
53  };
54 }
55 
56 #endif
AIToolbox::Bandit::RandomPolicy::RandomPolicy
RandomPolicy(size_t a)
Basic constructor.
AIToolbox::Bandit::RandomPolicy::getActionProbability
virtual double getActionProbability(const size_t &a) const override
This function returns the probability of taking the specified action in the specified state.
AIToolbox::Bandit::PolicyInterface
Simple typedef for most of a normal Bandit's policy needs.
Definition: PolicyInterface.hpp:11
AIToolbox::Bandit::RandomPolicy::getPolicy
virtual Vector getPolicy() const override
This function returns a vector containing all probabilities of the policy.
AIToolbox::Vector
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
Definition: Types.hpp:16
AIToolbox::Bandit
Definition: Experience.hpp:6
PolicyInterface.hpp
AIToolbox::Bandit::RandomPolicy::sampleAction
virtual size_t sampleAction() const override
This function chooses a random action for state s, following the policy distribution.
AIToolbox::Bandit::RandomPolicy
This class represents a random policy.
Definition: RandomPolicy.hpp:12