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

Fixed route delivery inventory calculation

回答済み

コメント

1件のコメント

  • 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

サインインしてコメントを残してください。