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

Find the variable values for different solutions by PoolSolutions

回答済み

コメント

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.
  • Maliheh Aramon
    • Gurobi Staff

    Hi Ahmad, 

    After setting the parameter SolutionNumber to the \(i\)-th best solution, the value of each variable can be accessed by querying the attribute Xn and not X (this attribute always reports the variable values in the current solution). In the last part of your code when checking whether a variable is assigned to value 1 or not, you need to check:

    if x[i, j].Xn > 0.5:

    I ran your code and I was able to see different values assigned to variables \(x\).

    Best regards,

    Maliheh

    1
  • ahmad alanaqreh
    • Gurobi-versary
    • Conversationalist
    • Investigator

    Thank you so much Maliheh, now it is working in a proper way 

    0

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