Skip to main content

Error: 10005 Unable to retrieve attribute 'X'

Answered

Comments

2 comments

  • Official comment
    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?.
  • Jaromił Najman
    • Gurobi Staff

    Hi José,

    You model is infeasible. Thus, the ObjVal and X attributes are not available. You should only check for these attributes if your problem has been solved to optimality (or hit a timelimit). You can check the optimization status

    int optimstatus = model.get(GRB_IntAttr_Status);
    if (optimstatus == GRB_OPTIMAL) {
    // your code
    }

    Example mip2_c++ has some additional checks for the optimization status. To determine why your model is infeasible, please refer to the Knowledge Base article How do I determine why my model is infeasible?

    Best regards,
    Jaromił

    0

Post is closed for comments.