メインコンテンツへスキップ

Find the coefficient of a variable in a complex (very large) objective function

回答済み

コメント

3件のコメント

  • 正式なコメント
    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 Chris,

    Given only the name of a variable, you can get the variable object using the getVarByName function. You can then look up the objective coefficient of a given variable directly via variable attributes.

    Best regards,
    Jaromił

    0
  • Chris Domnisoru
    • Gurobi-versary
    • First Comment
    • First Question

    Thank you.

    Indeed, I overlooked the obj attribute and ended up with a more complex solution using the functionality of the linear expression object representing the objective.

    Thank you,

    Chris

    0

投稿コメントは受け付けていません。