Skip to main content

Function applied to variable for more flexible domain

Answered

Comments

2 comments

  • Simranjit Kaur
    Gurobi Staff Gurobi Staff

    You can define x as a semi-continuous variable. A semi-continuous variable has the property that it takes a value of 0 or a value between the specified lower and upper bounds. With the Python API, you can define your x variable as follows:

    x = model.addVar( lb = threshold, vtype = "S", name ="x")
    0
  • Alexander Chen
    First Comment
    First Question

    Thank you. I'll try it out

    0

Please sign in to leave a comment.