From 21d5ebb442b46924125be6cac788c7ba53e04641 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 18 May 2023 19:13:35 +0200 Subject: [PATCH] Fixed Bug: ToyEnv did not follow new gym spec --- test/test_black_box.py | 6 ++++-- test/test_replanning_sequencing.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/test_black_box.py b/test/test_black_box.py index ef397f1..c408079 100644 --- a/test/test_black_box.py +++ b/test/test_black_box.py @@ -32,10 +32,12 @@ class ToyEnv(gym.Env): def reset(self, *, seed: Optional[int] = None, return_info: bool = False, options: Optional[dict] = None) -> Union[ObsType, Tuple[ObsType, dict]]: - return np.array([-1]) + obs, options = np.array([-1]), {} + return obs, options def step(self, action: ActType) -> Tuple[ObsType, float, bool, dict]: - return np.array([-1]), 1, False, {} + obs, reward, terminated, truncated, info = np.array([-1]), 1, False, False, {} + return obs, reward, terminated, truncated, info def render(self, mode="human"): pass diff --git a/test/test_replanning_sequencing.py b/test/test_replanning_sequencing.py index 1fd5a84..1a35f99 100644 --- a/test/test_replanning_sequencing.py +++ b/test/test_replanning_sequencing.py @@ -26,10 +26,12 @@ class ToyEnv(gym.Env): def reset(self, *, seed: Optional[int] = None, return_info: bool = False, options: Optional[dict] = None) -> Union[ObsType, Tuple[ObsType, dict]]: - return np.array([-1]) + obs, options = np.array([-1]), {} + return obs, options def step(self, action: ActType) -> Tuple[ObsType, float, bool, dict]: - return np.array([-1]), 1, False, {} + obs, reward, terminated, truncated, info = np.array([-1]), 1, False, False, {} + return obs, reward, terminated, truncated, info def render(self, mode="human"): pass