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

2 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two 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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • 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

Post is closed for comments.