Gurobi in Python, TypeError: addConstr() takes at least 2 positional arguments (1 given)
AnsweredDear Gurobi professionals:
I am developing a MILP model on Python using Gurobi.
Below is the screenshot of my model constraint, whereby:
- DUR is a 2 by 1 array
- y_shift[e,d,s] is a decision variable
- HRS[d][e,t] is a dictionary which includes arrays in the value (when taken sum for HRS with regards to "t in T", there might be cases where the value would be equal to 0).
I checked on the Internet about similar cases (https://stackoverflow.com/questions/23620952/gurobierror-unable-to-convert-argument-to-an-expression).
But it seems the problem (if this is due to 0 summation/value on one side of the constraint) has been solved with regards to TempConstr a long time ago..
For your reference the error line from console is below:
What am I doing wrong? Your helps is greatly appreciated.
Odko
0
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Hi Odko,
The name of the first argument should be "lhs" (not "lhr").
Regards,
Silke
1 -
Hi Silke,
Thanks a lot! Just realised the typo! :)
Regards,
Odko
0
Post is closed for comments.
Comments
3 comments