Reporting results - attributes

Once the optimization is complete, we can query the values of the attributes. In particular, we can query theXvariable attributes to obtain the solution value for each variable:

print(x.X)

We can also query theobjValattribute on the model to obtain the objective value for the current solution:


                   

所有模型中,变量的名称和类型, and constraint attributes can be found in the online Python documentation. Typehelp(GRB.Attr)in the Gurobi Shell for details.