Model.getObjective()

getObjective ( )

Retrieve the model objective (as a linear or quadratic expression).

Return value:

The model objective. A LinExpr object for a linear model, or a QuadExpr object for a quadratic model.

Example usage:

  obj = model.getObjective()
  print(obj.getValue())