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

setObjective() not updating when called on GRBModel object

回答済み

コメント

3件のコメント

  • 正式なコメント
    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.
  • Jaromił Najman
    • Gurobi Staff

    You have to call the update method first before querying any model objects.

    obj = mod.setObjective(x+y, GRB.MAXIMIZE)
    mod.update()
    print(mod.getObjective())

    This is due to the lazy update mechanism.

    0
  • Sam Garvin
    • Gurobi-versary
    • Conversationalist
    • First Question

    Thank you for your prompt response!

    0

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