AIToolbox
A library that offers tools for AI problem solving.
|
This class represents the base interface for policies. More...
#include <AIToolbox/PolicyInterface.hpp>
Public Member Functions | |
PolicyInterface (State s, Action a) | |
Basic constructor. More... | |
virtual | ~PolicyInterface () |
Basic virtual destructor. More... | |
virtual Action | sampleAction (const Sampling &s) const =0 |
This function chooses a random action for state s, following the policy distribution. More... | |
virtual double | getActionProbability (const Sampling &s, const Action &a) const =0 |
This function returns the probability of taking the specified action in the specified state. More... | |
const State & | getS () const |
This function returns the number of states of the world. More... | |
const Action & | getA () const |
This function returns the number of available actions to the agent. More... | |
Protected Attributes | |
State | S |
Action | A |
RandomEngine | rand_ |
This class represents the base interface for policies.
This class represents an interface that all policies must conform to. The interface is generic as different methods may have very different ways to store and compute policies, and this interface simply asks for a way to sample them.
This class is templatized in order to work with as many problem classes as possible. It doesn't really implement any specific functionality, but should be used as a guide in order to decide which methods a new policy should have.
The State and Sampling parameters are separate since in POMDPs we still have "integer" states, but we often want to sample from beliefs. Having two separate parameters allows for this. In the MDP case they are both the same.
State | This defines the type that is used to store the state space. |
Sampling | This defines the type that is used to sample from the policy. |
Action | This defines the type that is used to handle actions. |
AIToolbox::PolicyInterface< State, Sampling, Action >::PolicyInterface | ( | State | s, |
Action | a | ||
) |
Basic constructor.
s | The number of states of the world. |
a | The number of actions available to the agent. |
|
virtual |
Basic virtual destructor.
const Action & AIToolbox::PolicyInterface< State, Sampling, Action >::getA |
This function returns the number of available actions to the agent.
|
pure virtual |
This function returns the probability of taking the specified action in the specified state.
s | The selected state. |
a | The selected action. |
Implemented in AIToolbox::EpsilonPolicyInterface< void, void, size_t >, AIToolbox::EpsilonPolicyInterface< State, State, Action >, AIToolbox::EpsilonPolicyInterface< size_t, size_t, size_t >, AIToolbox::MDP::WoLFPolicy, AIToolbox::MDP::PGAAPPPolicy, AIToolbox::MDP::QSoftmaxPolicy, AIToolbox::MDP::PolicyWrapper, AIToolbox::MDP::QGreedyPolicy, AIToolbox::MDP::BanditPolicyAdaptor< BanditPolicy >, and AIToolbox::EpsilonPolicyInterface< State, Sampling, Action >.
const State & AIToolbox::PolicyInterface< State, Sampling, Action >::getS |
This function returns the number of states of the world.
|
pure virtual |
This function chooses a random action for state s, following the policy distribution.
s | The sampled state of the policy. |
Implemented in AIToolbox::EpsilonPolicyInterface< void, void, size_t >, AIToolbox::EpsilonPolicyInterface< State, State, Action >, AIToolbox::MDP::WoLFPolicy, AIToolbox::EpsilonPolicyInterface< size_t, size_t, size_t >, AIToolbox::MDP::PGAAPPPolicy, AIToolbox::MDP::QSoftmaxPolicy, AIToolbox::MDP::PolicyWrapper, AIToolbox::MDP::BanditPolicyAdaptor< BanditPolicy >, AIToolbox::MDP::QGreedyPolicy, and AIToolbox::EpsilonPolicyInterface< State, Sampling, Action >.
|
protected |
|
mutableprotected |
|
protected |