MCPcopy Create free account
hub / github.com/rlcode/reinforcement-learning / __init__

Method __init__

1-grid-world/env.py:247–251  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

245 possible_actions = [0, 1, 2, 3]
246
247 def __init__(self):
248 self.width, self.height = WIDTH, HEIGHT
249 self.reward = [[0.0] * WIDTH for _ in range(HEIGHT)]
250 self.reward[2][2], self.reward[1][2], self.reward[2][1] = 1.0, -1.0, -1.0
251 self.all_state = [[x, y] for x in range(WIDTH) for y in range(HEIGHT)]
252
253 def get_all_states(self):
254 return self.all_state

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected