How to get bounds in solfile
回答済みHi, I am using SolFile to output intermediate solutions found in an optimization process, but the solution files do not have bounds in them. Is there any way I can get the bounds?
Thanks.
-
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 -
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 -
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
サインインしてコメントを残してください。
コメント
3件のコメント