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

Method _state

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

Source from the content-addressed store, hash-verified

201 return self._state(), reward, done
202
203 def _state(self):
204 ax, ay = self.agent
205 s = []
206 for o in self.obstacles:
207 ox, oy = o["state"]
208 s += [ox - ax, oy - ay, -1, o["direction"]]
209 s += [self.goal[0] - ax, self.goal[1] - ay, 1]
210 return s
211
212 def render(self):
213 if self.render_mode is None: return

Callers 2

resetMethod · 0.95
stepMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected