Inconsistency between grb log file and model attributes
回答済みHi, I am trying to solve a simple linear problem with two objective function in which the firrst function has priority over the second one (the second function serves as a tie-breaker) I save the optmization resutls in a log file in which I have objective values for functions. Moreover, I collect the model attributes as well which bontains MIPgap LPbound Objvals, etc. I noticed the objective value for the primary objective function in the log file is different from the corresponding value when I collect the attributes. Am I missing something? The secondary objective functions have the same value in both places. This does not happen when I use a single obj function in the problem. Thanks
-
Hi Mohammad,
You can access the objective values as follows:
for obj_index in range(model.numObj): model.params.ObjNumber = obj_index print(f"The value of the Objective Function {model.objNName} is: {model.objNVal}.")If you're using an older version of Gurobi, note that there is a known issue where the objective value may be reported incorrectly in the log file. This has been resolved in newer versions. You can find more details about the issue here.
Kind regards,
Charmae
0
サインインしてコメントを残してください。
コメント
1件のコメント