AIToolbox
A library that offers tools for AI problem solving.
SparseCooperativeQLearning.hpp
Go to the documentation of this file.
1 #ifndef AI_TOOLBOX_FACTORED_MDP_SPARSE_COOPERATIVE_QLEARNING_HEADER_FILE
2 #define AI_TOOLBOX_FACTORED_MDP_SPARSE_COOPERATIVE_QLEARNING_HEADER_FILE
3 
5 
8 
9 namespace AIToolbox::Factored::MDP {
32  public:
50  SparseCooperativeQLearning(State S, Action A, const std::vector<QFunctionRule> & rules, double discount, double alpha);
51 
76  void setLearningRate(double a);
77 
83  double getLearningRate() const;
84 
97  void setDiscount(double d);
98 
104  double getDiscount() const;
105 
125  Action stepUpdateQ(const State & s, const Action & a, const State & s1, const Rewards & rew);
126 
132  const State & getS() const;
133 
139  const Action & getA() const;
140 
147 
148  private:
149  State S;
150  Action A;
151  double discount_, alpha_;
152 
154  QGreedyPolicy<> policy_;
155  };
156 }
157 
158 #endif
AIToolbox::Factored::MDP::SparseCooperativeQLearning::setLearningRate
void setLearningRate(double a)
This function sets the learning rate parameter.
AIToolbox::Factored::MDP::SparseCooperativeQLearning::setDiscount
void setDiscount(double d)
This function sets the new discount parameter.
AIToolbox::Factored::MDP::SparseCooperativeQLearning::getLearningRate
double getLearningRate() const
This function will return the current set learning rate parameter.
AIToolbox::Factored::MDP::QGreedyPolicy
This class implements a greedy policy through a QFunction.
Definition: QGreedyPolicy.hpp:23
AIToolbox::Factored::MDP::SparseCooperativeQLearning::SparseCooperativeQLearning
SparseCooperativeQLearning(State S, Action A, const std::vector< QFunctionRule > &rules, double discount, double alpha)
Basic constructor.
AIToolbox::Factored::MDP::SparseCooperativeQLearning::stepUpdateQ
Action stepUpdateQ(const State &s, const Action &a, const State &s1, const Rewards &rew)
This function updates the internal QFunctionRules based on experience.
AIToolbox::Factored::Rewards
Vector Rewards
Definition: Types.hpp:71
AIToolbox::Factored::MDP::SparseCooperativeQLearning::getQFunctionRules
const FilterMap< QFunctionRule > & getQFunctionRules() const
This function returns a reference to the internal FilterMap of QFunctionRules.
QGreedyPolicy.hpp
FilterMap.hpp
AIToolbox::Factored::MDP
Definition: CooperativePrioritizedSweeping.hpp:13
AIToolbox::Factored::State
Factors State
Definition: Types.hpp:67
AIToolbox::Factored::MDP::SparseCooperativeQLearning
This class represents the Sparse Cooperative QLearning algorithm.
Definition: SparseCooperativeQLearning.hpp:31
AIToolbox::Factored::MDP::SparseCooperativeQLearning::getA
const Action & getA() const
This function returns the action space on which SparseCooperativeQLearning is working.
AIToolbox::Factored::MDP::SparseCooperativeQLearning::getDiscount
double getDiscount() const
This function returns the currently set discount parameter.
AIToolbox::Factored::Action
Factors Action
Definition: Types.hpp:69
AIToolbox::Factored::FilterMap
This class is a container which uses PartialFactors as keys.
Definition: FilterMap.hpp:22
AIToolbox::Factored::MDP::SparseCooperativeQLearning::getS
const State & getS() const
This function returns the state space on which SparseCooperativeQLearning is working.
Types.hpp