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

How to get bounds in solfile

回答済み

コメント

4件のコメント

  • 正式なコメント
    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

    There is no option to automatically write variable bounds to solution files. You would have to write an additional file after the optimization is finished which writes all variable bounds.

    file = open("bounds.txt",'w')
    for v in model.getVars():
    file.write("%s %f %f\n"%(v.VarName,v.lb,v.ub))
    file.close()

    Best regards, 
    Jaromił

    0
  • Qi He
    • Gurobi-versary
    • First Comment
    • First Question

    Thanks for the reply. Sorry, I was not being clear, is there a way to find objective bounds when getting intermediate solutions? It seems like ObjBound can only be accessed after the optimization, is that true?

    0
  • Jaromił Najman
    • Gurobi Staff

    By ObjBound, do you mean the dual bound or the objective value at the given solution point? The objective value is reported at the top of SolFiles. The ObjBound is not reported, because it is independent of a given solution point.

    Best regards, 
    Jaromił

    0

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