mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-04 20:23:04 +02:00
11 lines
376 B
Python
11 lines
376 B
Python
|
|
import gymnasium as gym
|
||
|
|
env = gym.make("LunarLander-v2", render_mode="human")
|
||
|
|
observation, info = env.reset(seed=42)
|
||
|
|
for _ in range(1000):
|
||
|
|
action = env.action_space.sample() # this is where you would insert your policy
|
||
|
|
observation, reward, terminated, truncated, info = env.step(action)
|
||
|
|
|
||
|
|
if terminated or truncated:
|
||
|
|
observation, info = env.reset()
|
||
|
|
|
||
|
|
env.close()
|