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

Extension to continuous action space #5

Open
rsuwa opened this issue Jan 18, 2020 · 1 comment
Open

Extension to continuous action space #5

rsuwa opened this issue Jan 18, 2020 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@rsuwa
Copy link

rsuwa commented Jan 18, 2020

Is it easy to change the action space from discrete to continuous to implement multi-agent DDPG?

@praveen-palanisamy
Copy link
Owner

praveen-palanisamy commented Feb 1, 2020

Hey @rsuwa , sorry for the delayed response. I somehow missed this.

Yes. The environments support continuous actions. By default they are configured to use discrete actions as the V-Trace algorithm used in IMPALA supports only discrete actions.

You can start using continuous actions in two ways:

  1. Creating a new environment (recommended & it's easy enough; Details are listed below)
  2. Modifying existing environment (not-recommended but just needs a one word change)

One way to create a new environment is to simply copy and replicate an existing environment and change what you want and give it a new name. For example, to create a variation of this
UrbanSignalIntersection3Car environment with continuous actions, you can copy this file, rename it (e.g.: urban_signal_intersection_3c_continuous.py) and edit the following line:


and set "discrete_actions": False.

That's it!

You can give this environment a new name (e.g.: UrbanSignalIntersection3CarContinuous) by registering this new environment with it's name like the existing discrete environment shown below:

from macad_gym.envs.intersection.urban_signal_intersection_3c \
import UrbanSignalIntersection3Car

The last step is to add it to the list of available environments here:

_AVAILABLE_ENVS = {

You can then just use: gym.make("UrbanSignalIntersection3CarContinuous-v0") in your code!

Let me know if you need more help. Also, feel free to submit a pull request with your new environment!

@praveen-palanisamy praveen-palanisamy added enhancement New feature or request good first issue Good for newcomers labels Feb 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants