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

About the parameter input and output of iterative algorithm in gurobi

回答済み

コメント

4件のコメント

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

    It is hard to determine what you are trying to achieve from your description and the short code snippets.

    I guess you are adding \(\texttt{q}\) via the addVars function correct? After a successful optimization run, you can retrieve all variable solution values via the X attribute. So you could go with something like

    if model.Status == GRB.OPTIMAL:
    for i in range(4):
    for j in range(3):
    qc[i][j] = q[i,j].X

    Best regards,
    Jaromił

    0
  • Yanbo Fan
    • Gurobi-versary
    • Investigator
    • Thought Leader

    Hi,

    Thanks to your help, I have successfully solved the problem.

    Best regards,

    Yanbo

     

    0
  • Yanbo Fan
    • Gurobi-versary
    • Investigator
    • Thought Leader

    Hi Jaromił Najman,

    Could you help me answer my new question? My question has been posted for a few days, but no one answered it. 

    Best regards,

    Yanbo

    0

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