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

How to get bounds in solfile

回答済み

コメント

3件のコメント

  • Jaromił Najman
    • Gurobi Staff 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 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

サインインしてコメントを残してください。