-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Question: Correct way to do use value of an integer variable for indexing #164
Comments
Thanks for opening the issue. The short version: This is currently not possible. |
Is there a recommended workaround way of doing what I'm trying to do above, but without indexing by the value of the variable? If not, I'm relatively confident I can do the above as a binary programming problem, I just wanted to use |
I would write it as a binary problem as well. At least currently I can't think of a workaround. |
I'm getting closer with this one as you seem to only need it for constant arrays. (#213) The problem here is also that you do some boolean logic inside the indexing which I don't have an idea for how to accomplish that kind of magic yet 😄 |
I have
p
products, and for each product I have a possibility ofl
price levels. For each such product and price level, I have the expected quantity sold, in aDataFrame
calledvals
. I want to add a constraint that the total quantity sold must be greater than a constant.If I used a binary programming approach, I would multiply each product's potential quantity by the binary decision variable. But I'm trying to solve this using an integer decision variable to represent the price level, and I realise I don't know how to use the value of a given variable as a lookup.
What I tried:
However, this does not work.
Is this sort of "indexing by the value of a variable" even possible? If so, what would a good design for such a thing look like?
The text was updated successfully, but these errors were encountered: