From 55df1e0ef6e985d3a4ac357849a516042089a544 Mon Sep 17 00:00:00 2001 From: Hongyi Zhou Date: Thu, 1 Dec 2022 13:16:37 +0100 Subject: [PATCH] fix minor bug --- fancy_gym/black_box/black_box_wrapper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fancy_gym/black_box/black_box_wrapper.py b/fancy_gym/black_box/black_box_wrapper.py index d5bd7e6..9d138cc 100644 --- a/fancy_gym/black_box/black_box_wrapper.py +++ b/fancy_gym/black_box/black_box_wrapper.py @@ -147,7 +147,7 @@ class BlackBoxWrapper(gym.ObservationWrapper): position, velocity = self.get_trajectory(action) position, velocity = self.env.set_episode_arguments(action, position, velocity) - traj_is_valid = self.env.preprocessing_and_validity_callback(action, position, velocity) + traj_is_valid, position, velocity = self.env.preprocessing_and_validity_callback(action, position, velocity) trajectory_length = len(position) rewards = np.zeros(shape=(trajectory_length,)) @@ -159,7 +159,7 @@ class BlackBoxWrapper(gym.ObservationWrapper): infos = dict() done = False - if not traj_is_valid: + if traj_is_valid is False: obs, trajectory_return, done, infos = self.env.invalid_traj_callback(action, position, velocity, self.return_context_observation) return self.observation(obs), trajectory_return, done, infos