WUT_Computer_Science/main.py

17 lines
371 B
Python
Raw Normal View History

2024-10-27 20:27:56 +01:00
import metadrive
2024-10-04 14:31:22 +02:00
2024-10-27 20:27:56 +01:00
# Initialize the MetaDrive environment
env = metadrive.MetaDriveEnv()
2024-10-04 14:31:22 +02:00
2024-10-27 20:27:56 +01:00
# Reset the environment to start a new episode
env.reset()
# Run the environment for a few steps
for _ in range(10):
env.step(env.action_space.sample()) # Take random actions
print("Hello, MetaDrive World!") # Print a greeting
# Close the environment after use
env.close()