Skip to main content

Values of parts of objective function

Answered

Comments

1 comment

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Pavithra,

    The possibly easiest way to access those values is to introduce 2 auxiliary variables and the equality constraints

    aux1 = sum(production_variable * production_cost)
    aux2 = sum(inventory_variable * inventory_cost)

    and access their respective values after the optimization is completed.

    It is also possible to access the value of a LinExpr object via its getValue method. However, for this you would have to construct the linear expression of interest first.

    Best regards,
    Jaromił

    0

Please sign in to leave a comment.