Updated on 2024-11-12 GMT+08:00
Gym
Adding Gym on Function Details Page
Figure 1 Adding Gym
Importing Gym to Code
# Import Gym. import gym env = gym.make('CartPole-v0') env.reset() def handler(event,context): for _ in range(10): env.render() observation, reward, done, info, _ = env.step(env.action_space.sample()) # take a random action temp = env.step(env.action_space.sample()) # take a random action print('observation:{}, reward:{}, done:{}, info:{}'.format(observation, reward, done, info)) env.close()
Parent topic: Public Dependency Demos
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot