how can I print the value of my continuous variable?
回答済みI use gurobi+python to reproduce my model.and I set 2 continuous variable.
range(1,25) represents 24 hours.I want to print their value ,so I tried
then I got the result
so how could I print the value of my continuous variable?
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?. -
Hi Xinyue,
You can use the X attribute to retrieve a variable's value in the current solution. E.g.,
for t in range(1,25):
print(DESS[t].X)
print(CESS[t].X)I hope this helps!
0 -
Yes! It works.Thank you,Eli!
0
投稿コメントは受け付けていません。
コメント
3件のコメント