MCPcopy Create free account
hub / github.com/BindsNET/bindsnet / reset

Method reset

bindsnet/environment/environment.py:174–189  ·  view source on GitHub ↗

Wrapper around the OpenAI ``gym`` environment ``reset()`` function. :return: Observation from the environment.

(self, seed=None)

Source from the content-addressed store, hash-verified

172 return self.obs, self.reward, self.done, info
173
174 def reset(self, seed=None) -> torch.Tensor:
175 # language=rst
176 """
177 Wrapper around the OpenAI ``gym`` environment ``reset()`` function.
178
179 :return: Observation from the environment.
180 """
181 # Call gym's environment reset function.
182 self.obs, self.info = self.env.reset(seed=seed)
183 self.preprocess()
184
185 self.history = {i: torch.Tensor() for i in self.history}
186
187 self.episode_step_count = 0
188
189 return self.obs
190
191 def render(self) -> None:
192 # language=rst

Callers

nothing calls this directly

Calls 2

preprocessMethod · 0.95
resetMethod · 0.45

Tested by

no test coverage detected