How do I model complex conditional statements in Gurobi?
回答済みI have read the article How do I model conditional statements in Gurobi? – Gurobi Help Center
this question concern about two possibilities, so it can made a binary variable b thus indicates if () is true (b=1) or false (b=0).
I want to ask if the question is more complex how can i model it?
for example:

thanks very much
-
Hi 舒杨 钱,
Gurobi has an interface for modelling piecewise-linear objective functions. The linked section explains in detail how to define piecewise-linear functions in Gurobi. The method Model.setPWLObj() can be used in Python to set a piecewise-linear objective function, for example. Check the piecewise.py example for how to define piecewise-linear objective functions.
Gurobi also has an interface to define piecewise-linear constraints. The method Model.addGenConstrPWL() can be used in Python. Examples gc_pwl.py() and gc_pwl_func() are relevant examples that you might want to check.Related articles:
How do I model piecewise-linear functions?
Step Functions and Mixed Functions (OR in an OB World)- Riley
0
サインインしてコメントを残してください。
コメント
1件のコメント