Fixed: Typos

This commit is contained in:
Dominik Moritz Roth 2023-05-19 14:04:19 +02:00
parent e75ab89a37
commit e70a56a7e3

View File

@ -21,8 +21,8 @@ class TimeAwareObservation(gym.ObservationWrapper, gym.utils.RecordConstructorAr
gym.ObservationWrapper.__init__(self, env) gym.ObservationWrapper.__init__(self, env)
assert isinstance(env.observation_space, Box) assert isinstance(env.observation_space, Box)
if enforce_dtype_float32: if enforce_dtype_float32:
assert env.observation_space.dtype == np.float32, assert env.observation_space.dtype == np.float32, 'TimeAwareObservation was given an environment with a dtype!=np.float32 ('+str(
'TimeAwareObservation was given an environment with a dtype!=np.float32 ('+str(env.observation_space.dtype)+'). This requirement can be removed by setting enforce_dtype_float32=False.' env.observation_space.dtype)+'). This requirement can be removed by setting enforce_dtype_float32=False.'
dtype = env.observation_space.dtype dtype = env.observation_space.dtype
low = np.append(self.observation_space.low, 0.0) low = np.append(self.observation_space.low, 0.0)
high = np.append(self.observation_space.high, np.inf) high = np.append(self.observation_space.high, np.inf)
@ -38,7 +38,7 @@ class TimeAwareObservation(gym.ObservationWrapper, gym.utils.RecordConstructorAr
Returns: Returns:
The observation with the time step appended to (relative to total number of steps) The observation with the time step appended to (relative to total number of steps)
""" """
return np.append(observation, self.t / getattr(self.env, '_max_episode_steps') return np.append(observation, self.t / getattr(self.env, '_max_episode_steps'))
def step(self, action): def step(self, action):
"""Steps through the environment, incrementing the time step. """Steps through the environment, incrementing the time step.