AIToolbox
A library that offers tools for AI problem solving.
|
Go to the documentation of this file. 1 #ifndef AI_TOOLBOX_MDP_CORNER_PROBLEM_HEADER_FILE
2 #define AI_TOOLBOX_MDP_CORNER_PROBLEM_HEADER_FILE
53 using namespace GridWorldUtils;
61 for (
size_t x = 0; x < grid.
getWidth(); ++x ) {
62 for (
size_t y = 0; y < grid.
getHeight(); ++y ) {
64 if ( s == 0 || s == S-1 ) {
66 for (
size_t a = 0; a < A; ++a )
67 transitions[s][a][s] = 1.0;
70 for (
size_t a = 0; a < A; ++a ) {
74 if ( s == s1 ) transitions[s][a][s1] = 1.0;
76 transitions[s][a][s1] = stepUncertainty;
77 transitions[s][a][s] = 1.0 - stepUncertainty;
79 rewards[s][a][s1] = -1.0;
84 return Model(S, A, transitions, rewards, 0.95);