AIToolbox
A library that offers tools for AI problem solving.
|
This class is an interface to specify a policy through a QFunction. More...
#include <AIToolbox/MDP/Policies/QPolicyInterface.hpp>
Public Member Functions | |
QPolicyInterface (const QFunction &q) | |
Basic constructor. More... | |
const QFunction & | getQFunction () const |
This function returns the underlying QFunction reference. More... | |
Public Member Functions inherited from AIToolbox::MDP::PolicyInterface | |
virtual Matrix2D | getPolicy () const =0 |
This function returns a matrix containing all probabilities of the policy. More... | |
Public Member Functions inherited from AIToolbox::PolicyInterface< size_t, size_t, size_t > | |
PolicyInterface (size_t s, size_t a) | |
Basic constructor. More... | |
virtual | ~PolicyInterface () |
Basic virtual destructor. More... | |
virtual size_t | sampleAction (const size_t &s) const=0 |
This function chooses a random action for state s, following the policy distribution. More... | |
virtual double | getActionProbability (const size_t &s, const size_t &a) const=0 |
This function returns the probability of taking the specified action in the specified state. More... | |
const size_t & | getS () const |
This function returns the number of states of the world. More... | |
const size_t & | getA () const |
This function returns the number of available actions to the agent. More... | |
Protected Attributes | |
const QFunction & | q_ |
Protected Attributes inherited from AIToolbox::PolicyInterface< size_t, size_t, size_t > | |
size_t | S |
size_t | A |
RandomEngine | rand_ |
Additional Inherited Members | |
Public Types inherited from AIToolbox::MDP::PolicyInterface | |
using | Base = AIToolbox::PolicyInterface< size_t, size_t, size_t > |
This class is an interface to specify a policy through a QFunction.
This class provides a way to sample actions without the need to compute a full Policy from a QFunction. This is useful because often many methods need to modify small parts of a Qfunction for progressive improvement, and computing a full Policy at each step can become too expensive to do.
The type of policy obtained from such sampling is left to the implementation, since there are many ways in which such a policy may be formed.
AIToolbox::MDP::QPolicyInterface::QPolicyInterface | ( | const QFunction & | q | ) |
Basic constructor.
q | The QFunction this policy is linked with. |
const QFunction& AIToolbox::MDP::QPolicyInterface::getQFunction | ( | ) | const |
This function returns the underlying QFunction reference.
|
protected |