Skip to main content

Need a specific format of decision variable i.e. <gurobi.Var C0> instead of <gurobi.Var *Awaiting Model Update*> when I iterate over loop.? any idea how to get this.? I need this format to use specific package of neural network.

Answered

Comments

1 comment

  • Simranjit Kaur
    • Gurobi Staff

    Hi Vigneshwar,

    Model modification in Gurobi is performed in a lazy fashion, meaning that the modifications don't affect the model immediately. Instead, they are queued and are applied later, with the calls to model.update(), model.optimize() or model.write() methods.

    To access a variable attribute immediately after adding the variable to the model, please execute the model.update() method before accessing the variables.

    You can read more about Gurobi's lazy update approach here.

    Best regards,

    Simran

    1

Please sign in to leave a comment.