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

Feat : MultiCVRP wrapper #1043

Open
wants to merge 35 commits into
base: develop
Choose a base branch
from

Conversation

Louay-Ben-nessir
Copy link
Contributor

What?

adds a wrapper for multicvrp.

Why?

To make mulctivcrp mava compatible.

How?

This wrapper takes in the output from the multicvrp environment and converts it into a Mava suitable input.

Copy link
Contributor

@sash-a sash-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start! Big thing, make sure you use the MultiAgentWrapper Base class to avoid duplicating too much code

mava/utils/make_env.py Outdated Show resolved Hide resolved
mava/wrappers/jumanji.py Outdated Show resolved Hide resolved
mava/wrappers/jumanji.py Outdated Show resolved Hide resolved
mava/wrappers/jumanji.py Outdated Show resolved Hide resolved
mava/wrappers/jumanji.py Outdated Show resolved Hide resolved
mava/wrappers/jumanji.py Outdated Show resolved Hide resolved
mava/wrappers/jumanji.py Outdated Show resolved Hide resolved
mava/wrappers/jumanji.py Outdated Show resolved Hide resolved
mava/wrappers/jumanji.py Outdated Show resolved Hide resolved
Copy link
Contributor

@sash-a sash-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty great to me! Just gotta wait for the global state PR to go in so we can get rid of the hasattrs

mava/wrappers/jumanji.py Outdated Show resolved Hide resolved
sash-a
sash-a previously approved these changes Mar 12, 2024
Copy link
Contributor

@sash-a sash-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM to me also tested locally and seems to be running well!

Copy link
Collaborator

@RuanJohn RuanJohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Louay-Ben-nessir! 🔥 Just a few question and suggestions from my side.

mava/wrappers/jumanji.py Outdated Show resolved Hide resolved
mava/wrappers/jumanji.py Show resolved Hide resolved
mava/wrappers/jumanji.py Outdated Show resolved Hide resolved
mava/wrappers/jumanji.py Show resolved Hide resolved
sash-a
sash-a previously approved these changes Mar 18, 2024
mava/wrappers/jumanji.py Outdated Show resolved Hide resolved
mava/wrappers/jumanji.py Outdated Show resolved Hide resolved
mava/wrappers/jumanji.py Outdated Show resolved Hide resolved
mava/wrappers/jumanji.py Outdated Show resolved Hide resolved
mava/wrappers/jumanji.py Outdated Show resolved Hide resolved
mava/wrappers/jumanji.py Outdated Show resolved Hide resolved
mava/wrappers/jumanji.py Outdated Show resolved Hide resolved

def __init__(self, env: MultiCVRP, add_global_state: bool = False):
env.num_agents = env._num_vehicles
env.time_limit = env._num_customers + 1 # added for consistency
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I'm not very familiar with MultiCVRP 😅, I wanted to ask if the time_limit is only controlled in this way or if it can be set manually like in other environments?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jumanji's Multicvrp doesn't offer a way to manually set the time_limit. I changed it to None to better indicate this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants