Skip to main content

Change variable type?

Answered

Comments

4 comments

  • Eli Towle
    Gurobi Staff Gurobi Staff

    Hi Fulya,

    You can modify the VType attribute of the corresponding GRBVar object. E.g., in Java:

    v.set(GRB.CharAttr.VType, GRB.CONTINUOUS)

    Thanks,

    Eli

    1
  • Eli Towle
    Gurobi Staff Gurobi Staff

    Hi Fulya,

    You have to loop over the array and set the VType attribute for each GRBVar element individually.

    Thanks,

    Eli

    1
  • Fulya Terzi
    Gurobi-versary
    First Comment
    Curious

    Thank a lot. I got an error such as Cannot invoke set(GRB.CharAttr, char) on the array type GRBVar[].

    Since my object is GRBVar[]. How will I make for array type GRBVar?

     

    Thank you in advance

    0
  • Fulya Terzi
    Gurobi-versary
    First Comment
    Curious

    for (Map.Entry<String, GRBVar[]> varEntry : DecVariables.entrySet()) //IloIntVar[]

            varEntry.getValue(). set(GRB.CharAttr.VType, GRB.CONTINUOUS); // The error message: Cannot invoke set(GRB.CharAttr, char) on the array type GRBVar[]

    0

Please sign in to leave a comment.