mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-06 15:43:51 -09:00
Add a basic runtime test for the python-gymnasium package. This test verifies the fundamental operations of the library by: - Importing `gymnasium`. - Creating a "CartPole-v1" environment. - Resetting the environment. - Taking a random action step. - Closing the environment. Signed-off-by: Xukai Wang <kingxukai@zohomail.com> [Julien: - sort DEVELOPERS entries alphabetically - fix file name typo in DEVELOPERS - remove selection of dependencies in test config ] Signed-off-by: Julien Olivain <ju.o@free.fr>
9 lines
222 B
Python
9 lines
222 B
Python
import gymnasium as gym
|
|
env = gym.make("CartPole-v1")
|
|
|
|
observation, info = env.reset()
|
|
random_action = env.action_space.sample()
|
|
next_observation, reward, terminated, truncated, info = env.step(random_action)
|
|
|
|
env.close()
|