struct GridWorld {
&FloatTensor cells;
unsigned long width;
unsigned long height;
unsigned long start;
unsigned long state;
float stepReward;
float pitReward;
float goalReward;
int pitTerminal;
float slip;
unsigned long steps;
unsigned long maxSteps;
struct Rng rng;
}Fields
[height * width] GRID_* tags, row 0 at the top
state index y * width + x
every move (default -1)
default -100
default 0
default 0 (cliff walk: back to start)
probability the move goes a random way (0)
truncation (default 1000)
Methods
-> start state
One-hot observation of a state (for neural agents), obs has states() values.
= drop()
§
static struct GridWorld new(unsigned long width, unsigned long height, unsigned long seed)source · definitionAn empty w x h grid, start top-left, goal bottom-right.
The 12 x 4 cliff walk: start bottom-left, goal bottom-right, the bottom row between them a cliff (-100, back to start).