AIToolbox
A library that offers tools for AI problem solving.
EpsilonPolicy.hpp
Go to the documentation of this file.
1
#ifndef AI_TOOLBOX_FACTORED_BANDIT_EPSILON_POLICY_HEADER_FILE
2
#define AI_TOOLBOX_FACTORED_BANDIT_EPSILON_POLICY_HEADER_FILE
3
4
#include <
AIToolbox/Factored/Bandit/Policies/PolicyInterface.hpp
>
5
#include <
AIToolbox/EpsilonPolicyInterface.hpp
>
6
7
namespace
AIToolbox::Factored::Bandit
{
8
class
EpsilonPolicy
:
public
PolicyInterface
,
public
EpsilonPolicyInterface
<void, void, Action> {
9
public
:
10
using
EpsilonBase
=
EpsilonPolicyInterface<void, void, Action>
;
11
24
EpsilonPolicy
(
const
PolicyInterface
& p,
double
epsilon = 0.1);
25
26
protected
:
32
virtual
Action
sampleRandomAction
()
const override
;
33
39
virtual
double
getRandomActionProbability
()
const override
;
40
41
// Used to sampled random actions
42
mutable
std::vector<std::uniform_int_distribution<size_t>>
randomDistribution_
;
43
};
44
}
45
46
#endif
47
AIToolbox::Factored::Bandit::EpsilonPolicy::sampleRandomAction
virtual Action sampleRandomAction() const override
This function returns a random action in the Action space.
AIToolbox::Factored::Bandit::EpsilonPolicy::randomDistribution_
std::vector< std::uniform_int_distribution< size_t > > randomDistribution_
Definition:
EpsilonPolicy.hpp:42
PolicyInterface.hpp
AIToolbox::EpsilonPolicyInterface< void, void, Action >
This class represents the base interface for epsilon policies in games and bandits.
Definition:
EpsilonPolicyInterface.hpp:160
AIToolbox::Factored::Bandit::EpsilonPolicy::EpsilonPolicy
EpsilonPolicy(const PolicyInterface &p, double epsilon=0.1)
Basic constructor.
AIToolbox::Factored::Bandit::EpsilonPolicy
Definition:
EpsilonPolicy.hpp:8
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::EpsilonPolicyInterface
This class is a policy wrapper for epsilon action choice.
Definition:
EpsilonPolicyInterface.hpp:29
AIToolbox::Factored::Bandit::EpsilonPolicy::getRandomActionProbability
virtual double getRandomActionProbability() const override
This function returns the probability of picking a random action.
EpsilonPolicyInterface.hpp
AIToolbox::Factored::Bandit
Definition:
GraphUtils.hpp:12