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

How do I close gurobi log text file

回答済み

コメント

2件のコメント

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

    Unfortunately not; logs are written by the underlying Gurobi C library. However, you could use a message callback to capture the Gurobi output line by line, then do whatever you want with it. For example:

    def cb(model, where):
      if where == GRB.Callback.MESSAGE:
            msg = model.cbGet(GRB.Callback.MSG_STRING)
            # do something with msg here

    model.optimize(cb)

    The callback.py example is a good place to start. It uses a message callback to write and manage its own log file.

    0

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