Skip to content

Commit

Permalink
Fixed broken CartPoleVectorEnv.render(). Fixes Farama-Foundation#1007
Browse files Browse the repository at this point in the history
  • Loading branch information
TimSchneider42 committed Apr 10, 2024
1 parent 6047a8c commit bcfc3e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gymnasium/envs/classic_control/cartpole.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ def render(self):
for _ in range(self.num_envs)
]
if self.clocks is None:
self.clock = [pygame.time.Clock() for _ in range(self.num_envs)]
self.clocks = [pygame.time.Clock() for _ in range(self.num_envs)]

world_width = self.x_threshold * 2
scale = self.screen_width / world_width
Expand All @@ -558,7 +558,7 @@ def render(self):
return None

for state, screen, clock in zip(self.state, self.screens, self.clocks):
x = self.state.T
x = state

self.surf = pygame.Surface((self.screen_width, self.screen_height))
self.surf.fill((255, 255, 255))
Expand Down

0 comments on commit bcfc3e6

Please sign in to comment.