Skip to main content

Values of parts of objective function

Answered

Comments

2 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Jaromił Najman
    • 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

Post is closed for comments.