Allow manual reseting of path via arg to reset()
This commit is contained in:
parent
66c9509c27
commit
70536b79e7
@ -266,7 +266,7 @@ class ColumbusEnv(gym.Env):
|
|||||||
self.agent.pos = self.start_pos
|
self.agent.pos = self.start_pos
|
||||||
# Expand this function
|
# Expand this function
|
||||||
|
|
||||||
def reset(self):
|
def reset(self, force_reset_path=False):
|
||||||
pygame.init()
|
pygame.init()
|
||||||
self._init = True
|
self._init = True
|
||||||
self._steps = 0
|
self._steps = 0
|
||||||
@ -286,7 +286,7 @@ class ColumbusEnv(gym.Env):
|
|||||||
self.setup()
|
self.setup()
|
||||||
self.entities.append(self.agent) # add it last, will be drawn on top
|
self.entities.append(self.agent) # add it last, will be drawn on top
|
||||||
self.observable.reset()
|
self.observable.reset()
|
||||||
if self.clear_path_on_reset:
|
if self.clear_path_on_reset or force_reset_path:
|
||||||
self._reset_paths()
|
self._reset_paths()
|
||||||
return self.observable.get_observation()
|
return self.observable.get_observation()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user