sail-sg / envpool

C++-based high-performance parallel environment execution engine (vectorized env) for general RL environments.
https://envpool.readthedocs.io
Apache License 2.0
1.08k stars 99 forks source link

How to compile new environment into EnvPool #28

Closed quark2019 closed 2 years ago

quark2019 commented 2 years ago

After following to Add New Environment into EnvPool, I've finished coding on a new self-define Env. How to compile the codes and add new env into EnvPool? (https://envpool.readthedocs.io/en/latest/pages/build.html shows how to build EnvPool, but not build new Env.)

eg, how to compile the example Dummy Env into EnvPool?

Please take some time to update https://envpool.readthedocs.io/en/latest/pages/env.html, thanks!

Trinkle23897 commented 2 years ago

I'm trying to serve #25 as a minimal example to show how to integrate new environments. After that pull request merges, I'll update the documentation accordingly. Stay tuned!

AlessandroZavoli commented 2 years ago

Thank you for this amazing work! I had the same problem, I don't understand how to compile the code and where to put it. Is it necessary to clone envpool and install it from scratch? Or can it be used via pip install envpool?

Best, Alessandro

Trinkle23897 commented 2 years ago

https://envpool.readthedocs.io/en/latest/pages/env.html

If you want to integrate your new env into envpool, it's necessary to build from scratch (because we use Bazel build system to compile a binary .so file).

AlessandroZavoli commented 2 years ago

Thanks! Is the best practice fork the project and add the new environment in the envpool folder? If so, you might consider adding this sentence on top of that page.

Trinkle23897 commented 2 years ago

Will do that, thanks for the suggestion!