AIToolbox
A library that offers tools for AI problem solving.
|
Go to the documentation of this file. 1 #ifndef AI_TOOLBOX_MDP_EXPERIENCE_HEADER_FILE
2 #define AI_TOOLBOX_MDP_EXPERIENCE_HEADER_FILE
52 template <IsNaive3DTable V>
91 template <IsNaive2DMatrix R>
127 template <IsNaive2DMatrix MM>
154 void record(
size_t s,
size_t a,
size_t s1,
double rew);
175 unsigned long getVisits(
size_t s,
size_t a,
size_t s1)
const;
191 double getReward(
size_t s,
size_t a)
const;
199 double getM2(
size_t s,
size_t a)
const;
263 unsigned long timesteps_;
268 template <IsNaive3DTable V>
270 visitsSum_.setZero();
271 for (
size_t s = 0; s < S; ++s ) {
272 for (
size_t a = 0; a < A; ++a ) {
273 for (
size_t s1 = 0; s1 < S; ++s1 ) {
274 visits_[a](s, s1) = v[s][a][s1];
275 visitsSum_(s, a) += v[s][a][s1];
281 template <IsNaive2DMatrix R>
283 for (
size_t s = 0; s < S; ++s )
284 for (
size_t a = 0; a < A; ++a )
285 rewards_(s, a) = r[s][a];
288 template <IsNaive2DMatrix MM>
290 for (
size_t s = 0; s < S; ++s )
291 for (
size_t a = 0; a < A; ++a )
292 M2s_(s, a) = m[s][a];