feat: hello world open ai gymnasium

This commit is contained in:
KRZYSZTOF RUDNICKI 2024-10-04 14:31:22 +02:00
parent d6dd0abd79
commit 07e68108ec
4 changed files with 19 additions and 1 deletions

1
.gitignore vendored
View File

@ -160,3 +160,4 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
lectures

View File

@ -1 +1,5 @@
# USD
# USD
Install swig, python and pip
Install libraries required by program:
`pip install -r requirements.txt`

11
main.py Normal file
View File

@ -0,0 +1,11 @@
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()

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
gymnasium
gymnasium[box2d]