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

Method reset

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

Source from the content-addressed store, hash-verified

166 self._screen = None
167
168 def reset(self):
169 # Capture the prior episode's final score before wiping.
170 if self.counter > 0:
171 self.last_score = self.score
172 self.episode += 1
173 self.agent, self.counter, self.score, self._hit = [0, 0], 0, 0.0, 0
174 self.obstacles = [{"state": list(p), "direction": -1} for p in self.obstacles_init]
175 if self._screen is not None:
176 self.render(); time.sleep(0.3)
177 return self._state()
178
179 def step(self, action):
180 self.counter += 1

Callers

nothing calls this directly

Calls 2

renderMethod · 0.95
_stateMethod · 0.95

Tested by

no test coverage detected