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

Fixed route delivery inventory calculation

回答済み

コメント

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.
  • Marika Karbstein
    • Gurobi Staff

    Hi Pim,

    Please see this comment from my colleague on how to troubleshoot.

    A minor remark to your model. I think you accidentally used the same names for some variables, for example, for x and v. A bit easier is it to rewrite

    x = {} 
    for i in I:
        for j in J:
            x[i,j] = model.addVar(lb=0, vtype= GRB.BINARY, name='X[' + str(i) + str(j) + ']')

    as 

    x = model.addVars(I,J,lb=0, vtype= GRB.BINARY, name='x')

    which gives you the appropriate names and you can use x[i,j] as you did when defining constraints. 
    Something similar can be done for the constraints as well.

    Best regards,
    Marika

    0

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