AIToolbox
A library that offers tools for AI problem solving.
JointActionLearner.hpp
Go to the documentation of this file.
1 #ifndef AI_TOOLBOX_FACTORED_MDP_JOINT_ACTION_LEARNER_HEADER_FILE
2 #define AI_TOOLBOX_FACTORED_MDP_JOINT_ACTION_LEARNER_HEADER_FILE
3 
6 
8 
10 
11 namespace AIToolbox::Factored::MDP {
36  public:
46  JointActionLearner(size_t S, Action A, size_t id, double discount = 1.0, double alpha = 0.1);
47 
64  void stepUpdateQ(size_t s, const Action & a, size_t s1, double rew);
65 
72 
79 
96  void setLearningRate(double a);
97 
103  double getLearningRate() const;
104 
117  void setDiscount(double d);
118 
124  double getDiscount() const;
125 
131  size_t getS() const;
132 
138  const Action & getA() const;
139 
145  size_t getId() const;
146 
147  private:
148  Action A;
149  size_t id_;
150 
151  std::vector<unsigned> stateCounters_;
152  boost::multi_array<std::vector<unsigned>, 2> stateActionCounts_;
153 
154  AIToolbox::MDP::QFunction singleQFun_;
155  PartialFactorsEnumerator jointActions_;
156 
157  AIToolbox::MDP::QLearning qLearning_;
158  };
159 }
160 
161 #endif
AIToolbox::MDP::QFunction
Matrix2D QFunction
Definition: Types.hpp:52
AIToolbox::Factored::MDP::JointActionLearner::getA
const Action & getA() const
This function returns the action space on which JointActionLearner is working.
AIToolbox::Factored::MDP
Definition: CooperativePrioritizedSweeping.hpp:13
AIToolbox::MDP::QLearning
This class represents the QLearning algorithm.
Definition: QLearning.hpp:44
AIToolbox::Factored::MDP::JointActionLearner::getId
size_t getId() const
This function returns the id of the agent represented by this class.
AIToolbox::Factored::MDP::JointActionLearner::getS
size_t getS() const
This function returns the number of states on which JointActionLearner is working.
AIToolbox::Factored::MDP::JointActionLearner::setLearningRate
void setLearningRate(double a)
This function sets the learning rate parameter.
AIToolbox::Factored::MDP::JointActionLearner
This class represents a single Joint Action Learner agent.
Definition: JointActionLearner.hpp:35
Core.hpp
AIToolbox::Factored::MDP::JointActionLearner::getDiscount
double getDiscount() const
This function returns the currently set discount parameter.
AIToolbox::Factored::MDP::JointActionLearner::stepUpdateQ
void stepUpdateQ(size_t s, const Action &a, size_t s1, double rew)
This function updates the internal joint QFunction.
AIToolbox::Factored::MDP::JointActionLearner::getLearningRate
double getLearningRate() const
This function will return the current set learning rate parameter.
AIToolbox::Factored::MDP::JointActionLearner::getSingleQFunction
const AIToolbox::MDP::QFunction & getSingleQFunction() const
This function returns the internal single QFunction.
AIToolbox::Factored::MDP::JointActionLearner::JointActionLearner
JointActionLearner(size_t S, Action A, size_t id, double discount=1.0, double alpha=0.1)
Basic constructor.
AIToolbox::Factored::Action
Factors Action
Definition: Types.hpp:69
QLearning.hpp
AIToolbox::Factored::PartialFactorsEnumerator
This class enumerates all possible values for a PartialFactors.
Definition: Core.hpp:531
AIToolbox::Factored::MDP::JointActionLearner::setDiscount
void setDiscount(double d)
This function sets the new discount parameter.
Types.hpp
Types.hpp
AIToolbox::Factored::MDP::JointActionLearner::getJointQFunction
const AIToolbox::MDP::QFunction & getJointQFunction() const
This function returns the internal joint QFunction.