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

Model creation fails for larger models with "NullPointerException: Cannot invoke "gurobi.GRBVar.getcolno()" because "v" is null"

回答済み

コメント

3件のコメント

  • 正式なコメント
    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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • Jaromił Najman
    • Gurobi Staff

    It is hard to help here without a minimal reproducible example. Your code snippet uses many objects and data structures not defined in the snippet. Additionally, please post a screenshot of the full error code.

    ' "v" is null' indicates that a variable object you pass is NULL instead of GRBVar. This may happen if, e.g., vars[Pair(a,b)] has not been added to the model yet.

    0
  • Sven Fiergolla
    • Gurobi-versary
    • First Comment
    • First Question

    Thanks for your quick reply.

    ' "v" is null' indicates that a variable object you pass is NULL instead of GRBVar. This may happen if, e.g., vars[Pair(a,b)] is not present.

    I kind of excluded this possibility and expected another error but you are right, some of the vars were not present. Now it's running like a charm.

    0

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