gurobi not iterable
回答済みHi, i have this following code, but if i try to optimize my object i always get gurobipy object is not iterabel

Is it because I only have one indice (t)? how can i fix this problem?
0
-
正式なコメント
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?. -
This is a duplicate of a StackOverflow question.
Copy of my answer for completeness:
You could write a small loop to check the individual data structures:
for t in range(T):
print(Q_a[t])
print(cost_gas[t])
print(Q_b[t])
print(cost_coal[t])
print(Q_c[t])
print(cost_oil[t])Or at least check for consistent sizes, e.g.:
assert len(cost_oil) == len(T)
There is also an issue in the way you formulate the objective. There is a trailing +, so it looks like the last summand is missing.
0
投稿コメントは受け付けていません。
コメント
2件のコメント