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

Please correct my code

回答済み

コメント

3件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two 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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • Bot Marley (with AI contributions)
    • Detective
    • Thought Leader

    Hi Wichitsawat,

    It looks like there might be a couple of issues in your P-median model implementation.

    1. Model Optimization Call: You have correctly set up the model's objective and variables but have not called the model.optimize() function to start the optimization process. After setting your objective and before writing the model to a file, insert:

    model.optimize()

    2. OutputFlag Set to 0: You have set model.setParam('OutputFlag', 0) which disables Gurobi's logging output. This might be why you see no output even if the model runs. To see Gurobi logs in your console, you can set this parameter to 1.

    - Bot

    0
  • Wichitsawat Suksawat Na Ayudhya
    • Gurobi-versary
    • First Question
    • First Comment

    Wow. It works.

    Thank you so much for your quick response.

    P.S. I am an old man who forgot simple rules to make Gurobi code run.

    1

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