AIToolbox
A library that offers tools for AI problem solving.
|
This class implements a greedy policy through a QFunction. More...
#include <AIToolbox/Factored/Bandit/Policies/QGreedyPolicy.hpp>
Public Member Functions | |
template<typename... Args> | |
QGreedyPolicy (Action a, const FilterMap< QFunctionRule > &q, Args &&...args) | |
Basic constructor with QFunctionRules. More... | |
template<typename... Args> | |
QGreedyPolicy (Action a, const QFunction &q, Args &&...args) | |
Basic constructor with QFunction. More... | |
virtual Action | sampleAction () const override |
This function chooses the greediest action for state s. More... | |
virtual double | getActionProbability (const Action &a) const override |
This function returns the probability of taking the specified action. More... | |
Maximizer & | getMaximizer () |
This function returns a reference to the internal maximizer. More... | |
const Maximizer & | getMaximizer () const |
This function returns a reference to the internal maximizer. More... | |
const Maximizer::Graph & | getGraph () const |
This function returns the currently set graph. 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 implements a greedy policy through a QFunction.
This class allows you to select effortlessly the best greedy actions from a given list of QFunctionRules. In order to compute the best action, or a given action probability the QGreedyPolicy must run VariableElimination on the stored rules, so the process can get a bit expensive.
AIToolbox::Factored::Bandit::QGreedyPolicy< Maximizer >::QGreedyPolicy | ( | Action | a, |
const FilterMap< QFunctionRule > & | q, | ||
Args &&... | args | ||
) |
Basic constructor with QFunctionRules.
a | The number of actions available to the agent. |
q | The QFunctionRules this policy is linked with. |
...args | Parameters to pass to the maximizer on construction. |
AIToolbox::Factored::Bandit::QGreedyPolicy< Maximizer >::QGreedyPolicy | ( | Action | a, |
const QFunction & | q, | ||
Args &&... | args | ||
) |
Basic constructor with QFunction.
a | The number of actions available to the agent. |
q | The QFunction this policy is linked with. |
...args | Parameters to pass to the maximizer on construction. |
|
overridevirtual |
This function returns the probability of taking the specified action.
a | The selected action. |
const Maximizer::Graph & AIToolbox::Factored::Bandit::QGreedyPolicy< Maximizer >::getGraph |
This function returns the currently set graph.
const Maximizer & AIToolbox::Factored::Bandit::QGreedyPolicy< Maximizer >::getMaximizer |
This function returns a reference to the internal maximizer.
This can be used to set the parameters of the chosen maximizer.
const Maximizer& AIToolbox::Factored::Bandit::QGreedyPolicy< Maximizer >::getMaximizer | ( | ) | const |
This function returns a reference to the internal maximizer.
|
overridevirtual |
This function chooses the greediest action for state s.
Implements AIToolbox::PolicyInterface< void, void, Action >.