[MacOs] Как ставить gym среду RocketLander v0 - ksetdekov/RL_in_ksp GitHub Wiki

  • Ставим gym: pip3 install gym

  • Ставим box2d-py: pip3 install box2d-py

  • Клонируем репу с нужной средой (в соседнюю папку с этим проектом): git clone https://github.com/Jeetu95/Rocket_Lander_Gym.git

  • Ставим все из склонированной папки: cd Rocket_Lander_Gym/ pip3 install .

------- все --------

Код для проверки:

import gym
import gym.spaces
import rocket_lander_gym


env = gym.make('RocketLander-v0')
env.reset()

PRINT_DEBUG_MSG = True


while True:
    env.render()
    action = env.action_space.sample()
    observation,reward,done,info =env.step(action)

    if PRINT_DEBUG_MSG:`
        print("Action Taken  ",action)
        print("Observation   ",observation)
        print("Reward Gained ",reward)
        print("Info          ",info,end='\n\n')

    if done:
        print("Simulation done.")
        break
env.close()