mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-04 14:43:08 +02:00
17 lines
371 B
Python
17 lines
371 B
Python
import metadrive
|
|
|
|
# Initialize the MetaDrive environment
|
|
env = metadrive.MetaDriveEnv()
|
|
|
|
# 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()
|