AIToolbox
A library that offers tools for AI problem solving.
|
This class represents a random policy. More...
#include <AIToolbox/Factored/Bandit/Policies/RandomPolicy.hpp>
Public Member Functions | |
RandomPolicy (Action a) | |
Basic constructor. More... | |
virtual Action | sampleAction () const override |
This function chooses a random action for state s, following the policy distribution. More... | |
const Action & | sampleActionNoAlloc () const |
This function chooses a random action for state s, following the policy distribution. More... | |
virtual double | getActionProbability (const Action &a) const override |
This function returns the probability of taking the specified action in the specified state. More... | |
Public Member Functions inherited from AIToolbox::PolicyInterface< void, void, Action > | |
PolicyInterface (Action a) | |
Basic constructor. More... | |
virtual | ~PolicyInterface () |
Basic virtual destructor. More... | |
virtual double | getActionProbability (const Action &a) const =0 |
This function returns the probability of taking the specified action. More... | |
const Action & | getA () const |
This function returns the number of available actions to the agent. More... | |
Additional Inherited Members | |
Public Types inherited from AIToolbox::Factored::Bandit::PolicyInterface | |
using | Base = AIToolbox::PolicyInterface< void, void, Action > |
Protected Attributes inherited from AIToolbox::PolicyInterface< void, void, Action > | |
Action | A |
RandomEngine | rand_ |
This class represents a random policy.
This class simply returns a random action every time it is polled.
AIToolbox::Factored::Bandit::RandomPolicy::RandomPolicy | ( | Action | a | ) |
Basic constructor.
a | The number of actions available to the agent. |
|
overridevirtual |
This function returns the probability of taking the specified action in the specified state.
a | The selected action. |
|
overridevirtual |
This function chooses a random action for state s, following the policy distribution.
Implements AIToolbox::PolicyInterface< void, void, Action >.
const Action& AIToolbox::Factored::Bandit::RandomPolicy::sampleActionNoAlloc | ( | ) | const |
This function chooses a random action for state s, following the policy distribution.
This function does not allocate memory each call.