14 lines
300 B
Python
14 lines
300 B
Python
import gymnasium as gym
|
|
|
|
env = gym.make("CarRacing-v3", render_mode="human")
|
|
obs, info = env.reset()
|
|
|
|
for _ in range(1000):
|
|
action = env.action_space.sample()
|
|
_, reward, terminated, truncated, _ = env.step(action)
|
|
|
|
if terminated or truncated:
|
|
obs, info = env.reset()
|
|
|
|
env.close()
|