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

model.intvars with shape ? #18

Open
cprudhom opened this issue Sep 28, 2023 · 3 comments
Open

model.intvars with shape ? #18

cprudhom opened this issue Sep 28, 2023 · 3 comments

Comments

@cprudhom
Copy link
Member

Could this API be useful?

ws = model.intvars((5,6), -1, 1, name="ws")

instead of:

ws = [ model.intvars(6, -1, 1, name="ws_"+str(i)) for i in range(5) ]
@dimitri-justeau
Copy link
Collaborator

I guess that the most convenient, and the most consistent with Choco would be creating a model.intvar_matrix method, what do you think ?

@cprudhom
Copy link
Member Author

I think that the shape version is more pythonic and probably that, if Java allowed this type of declaration we would have adopted it.
That would also reduce the API which is good I think.

@dimitri-justeau
Copy link
Collaborator

Ok, you conviced me, I'll do this asap

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