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

GurobiError: No variable names available to index

回答済み

コメント

5件のコメント

  • 正式なコメント
    Simranjit Kaur
    Gurobi Staff 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 Gurobi Staff

    Hi Rohan,

    You could see this error if you are trying to read a solution file into a model with no variables. Did you add variables to the model (named to match the variables in the .mst file) prior to calling Model.read()?

    Thanks,

    Eli

    0
  • Rohan Bhatia
    Gurobi-versary
    First Comment
    First Question

    Hi Eli! Thanks for the comment. Actually, the model contains all the variables when I'm calling model.read. I'm calling it just before model.optimize().

    Could there be any other reasons for this error?

    Thanks,
    Rohan

    0
  • Eli Towle
    Gurobi Staff Gurobi Staff

    Hi Rohan,

    Could you try calling Model.update() immediately before reading the .mst file? Thanks!

    Eli

    2
  • Rohan Bhatia
    Gurobi-versary
    First Comment
    First Question

    Hi Eli,

    It worked! Thanks!

    Rohan

    1

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