Conditional Constraints if-esle on decission variable
AnsweredHello Gurobi developers and users
I want to implement if else-conditional constraints on following variables :
d[i,t] = a continuous non-negative variable
Y[i,t] = A binary variable
Logic I need to implement :
- if d[t] == 1 then Y[t] becomes 1
- elif 1< d[t] > 1, then Y[t] becomes 0.
"t" represents just the index of the variable.
I have been looking at several posts for conditional constraints on this form and also tried big M method, but for this particular constraint involving > and < sign, it is somehow not working.
Any help would be highly appreciated.
Thanks
Best regards,
Rahul
-
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 Rahul,
This condition does not make sense to me:
elif 1 < d[t] > 1
What do you want to express here? Is this true for all values that are not exactly 1? Tying a discrete decision onto the precise value of a continuous variable is very unusual.
Cheers,
Matthias0
Post is closed for comments.
Comments
2 comments