メインコンテンツへスキップ

Retrieving Variable Attribute using Var.getAttr()

回答済み

コメント

3件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three 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.
  • Jaromił Najman
    • Gurobi Staff

    Hi Margi,

    What is the correct syntax using Var.getAttr() to check if Gurobi has picked up correct Variables?

    What exactly are you trying to achieve when you say "picked up correct variables"?

    You can access variable attributes after they have been processed to the model. Gurobi uses a lazy UpdateMode. To directly process the addition of new variables or a change of their attributes, you have to explicitly call model.update().

    Best regards, 
    Jaromił

     

    0
  • Tanmoy Das
    • Gurobi-versary
    • Investigator
    • Collaborator

    " check if Gurobi has picked up correct Variables"

    to check what are the variables in the model, I just write the model before optimizing it. I can see what are the variables, and what is the detail structure of the model by opening the .lp model file (which is human-readable), 

    model.write(f'Outputs/model_v16_{sub_index}.lp')
    0

投稿コメントは受け付けていません。