Skip to main content

Please correct my code

Answered

Comments

2 comments

  • 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
  • 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.

    0

Please sign in to leave a comment.