How to define a semi-continuous variable in Gurobi/Python?
回答済みHi
Suppose we have a continuous variable "x" and a parameter "\theta". Now, we want to define the variable "y" as follows:
y = \theta*x if x>0;
0 if x=0
I would be thankful to know how to model y. Thanks
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?. -
You can model this relationship with the single constraint \( y = \theta x \). If \( x \) equals \( 0 \), then \( \theta x \) also equals \( 0 \).
0
投稿コメントは受け付けていません。
コメント
2件のコメント