Objective Function Summation Help
回答済みI am a beginner to python and gurobi and am having issues creating the following objective function:

I have the following error: Unsupported type (<class 'generator'>) for LinExpr addition argument

h is a dictionary whose keys are in the list N, and the values are float
Dir is a dictionary whose keys are tuples, and the values are int
I'm having trouble finding what the generator class is.
It's likely that my model has other issues aside from type errors and any help is appreciated
-
Hi Richard,
You can formulate line 51 with just one gp.quicksum and one pair of parentheses. This should eliminate the error you are seeing.
Please be aware for future questions that you will generally get a more thorough answer and faster response if you post your code in the form of a minimum reproducible example.
- Riley
0
サインインしてコメントを残してください。
コメント
1件のコメント