在gym中注册自己的模拟器

参考:

https://github.com/openai/gym/issues/626
https://github.com/openai/gym/tree/master/gym/envs#how-to-create-new-environments-for-gym
https://github.com/openai/gym/blob/522c2c532293399920743265d9bc761ed18eadb3/gym/envs/__init__.py

The question is how to register your own environment in the registry
Lets say you have your own environment defined in the following structure:

myenv/
    __init__.py
    myenv.py

myenv.py contains the class for your environment. In init.py you put the following code:

from gym.envs.registration import register
register(
    id='MyEnv-v0',
    entry_point='myenv.myenv:MyEnv',#第一个myenv是文件夹名字,第二个myenv是文件名字,MyEnv是文件内类的名字
)

To use your own environment

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值