AIToolbox
A library that offers tools for AI problem solving.
|
This class represents a policy always picking the same action. More...
#include <AIToolbox/Factored/Bandit/Policies/SingleActionPolicy.hpp>
Public Member Functions | |
SingleActionPolicy (Action a) | |
Basic constructor. More... | |
virtual Action | sampleAction () const override |
This function always return the current action. More... | |
virtual double | getActionProbability (const Action &a) const override |
This function returns the probability of taking the specified action in the specified state. More... | |
void | updateAction (Action a) |
This function updates the currently hold action. More... | |
![]() | |
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 | |
![]() | |
using | Base = AIToolbox::PolicyInterface< void, void, Action > |
![]() | |
Action | A |
RandomEngine | rand_ |
This class represents a policy always picking the same action.
Since there are methods which in order to learn automatically compute a best action for the next time step, it is useful to be able to wrap those actions into a policy in order to be joined to other policies (like epsilon-greedy, for example).
This class is a simple wrapper that always return the last action that has been set.
AIToolbox::Factored::Bandit::SingleActionPolicy::SingleActionPolicy | ( | 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 always return the current action.
Implements AIToolbox::PolicyInterface< void, void, Action >.
void AIToolbox::Factored::Bandit::SingleActionPolicy::updateAction | ( | Action | a | ) |
This function updates the currently hold action.
a | The new action we must return. |