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

How to make Gurobi not printing the optimization information?

回答済み

コメント

7件のコメント

  • 正式なコメント
    Gwyneth Butera
    • Gurobi Staff

    Please see our article : How do I suppress all console output from Gurobi?

  • 正式なコメント
    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?.
  • Eli Towle
    • Gurobi Staff

    Hi Lin,

    You can disable console output by setting the LogToConsole parameter to 0. To additionally disable output to a logfile, use the LogFile or OutputFlag parameters.

    Thanks,

    Eli

    -1
  • Britt van Veggel
    • Gurobi-versary
    • First Comment

    Hi Eli,

    How do i use this LogToConsole? I cant find any clear information on the usage of it anywhere.

     

    Cheers,

    Britt

    1
  • Eli Towle
    • Gurobi Staff

    You can find examples of how to set parameters for each API in the Parameter Examples section of our documentation. E.g., in Python:

    import gurobipy as gp

    m = gp.Model()
    m.Params.LogToConsole = 0

    To also prevent license file information from printing to the console, please see the article How do I suppress all console output from Gurobi?.

    3
  • Dominik Bilicki
    • Gurobi-versary
    • First Comment

    Thanks, still very useful answer :)

    0
  • Esmaeil Delfaraz
    • Gurobi-versary
    • Conversationalist

    Hi,

    In case you use Gurobi with c++, you can use the following 

    // Env and model

    GRBEnv env = GRBEnv();

    GRBModel model = GRBModel(env);

    //Avoid printing the LP solution in console
    model.set(GRB_IntParam_LogToConsole, 0);

    0

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