Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using a gym environment in benchmarl #115

Closed
sAz-G opened this issue Jul 26, 2024 · 1 comment
Closed

using a gym environment in benchmarl #115

sAz-G opened this issue Jul 26, 2024 · 1 comment

Comments

@sAz-G
Copy link

sAz-G commented Jul 26, 2024

Hi everyone,

I am new to benchmarl and would like to create/integrate my own environment in order to train it in benchmarl.

I followed this tutorial on how to create a new task, but I do not exactly understand how to integrate my own environment.

Is it necessary to add the environment to torchrl like you did here?

Can I just import my gym environment and use its constructor as in this line? Or do I have to modify my environment to be able to use it in Benchmarl?

@matteobettini
Copy link
Collaborator

Hey!

thanks for asking this, I will work in adding more examples of this.

In multiagent settings the interface for gym environments is the one from PettingZoo

it is really easy to add your custom pettingzoo environment in benchmarl and you can see an example of how to do that in #84 (i ll add this example to the main repo examples)

in general, yes, you need a torchrl env in that line. But fortunately torchrl already has a wrapper for all petting zoo envs as shown above so you do not need to create a new one if you intend to use pettingzoo

@sAz-G sAz-G closed this as completed Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants