in safety_gym/envs/engine.py [0:0]
def reset(self):
''' Reset the physics simulation and return observation '''
self._seed += 1 # Increment seed
self.rs = np.random.RandomState(self._seed)
self.done = False
self.steps = 0 # Count of steps taken in this episode
# Set the button timer to zero (so button is immediately visible)
self.buttons_timer = 0
self.clear()
self.build()
# Save the layout at reset
self.reset_layout = deepcopy(self.layout)
cost = self.cost()
assert cost['cost'] == 0, f'World has starting cost! {cost}'
# Reset stateful parts of the environment
self.first_reset = False # Built our first world successfully
# Return an observation
return self.obs()