AIToolbox
A library that offers tools for AI problem solving.
RandomPolicy.hpp
Go to the documentation of this file.
1 #ifndef AI_TOOLBOX_FACTORED_BANDIT_RANDOM_POLICY_HEADER_FILE
2 #define AI_TOOLBOX_FACTORED_BANDIT_RANDOM_POLICY_HEADER_FILE
3 
5 
12  class RandomPolicy : public PolicyInterface {
13  public:
20 
26  virtual Action sampleAction() const override;
27 
35  const Action & sampleActionNoAlloc() const;
36 
44  virtual double getActionProbability(const Action & a) const override;
45 
46  private:
47  // Used to sample without allocating.
48  mutable Action action_;
49  // Used to sampled random actions
50  mutable std::vector<std::uniform_int_distribution<size_t>> randomDistributions_;
51  };
52 }
53 
54 #endif
AIToolbox::Factored::Bandit::RandomPolicy::sampleAction
virtual Action sampleAction() const override
This function chooses a random action for state s, following the policy distribution.
AIToolbox::Factored::Bandit::RandomPolicy
This class represents a random policy.
Definition: RandomPolicy.hpp:12
PolicyInterface.hpp
AIToolbox::Factored::Bandit::RandomPolicy::RandomPolicy
RandomPolicy(Action a)
Basic constructor.
AIToolbox::Factored::Action
Factors Action
Definition: Types.hpp:69
AIToolbox::Factored::Bandit::PolicyInterface
Simple typedef for most of a normal Bandit's policy needs.
Definition: PolicyInterface.hpp:11
AIToolbox::Factored::Bandit::RandomPolicy::getActionProbability
virtual double getActionProbability(const Action &a) const override
This function returns the probability of taking the specified action in the specified state.
AIToolbox::Factored::Bandit::RandomPolicy::sampleActionNoAlloc
const Action & sampleActionNoAlloc() const
This function chooses a random action for state s, following the policy distribution.
AIToolbox::Factored::Bandit
Definition: GraphUtils.hpp:12