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

Issues implementing rolling horizon methodology in supply chain problem

回答済み

コメント

2件のコメント

  • Marika Karbstein
    • Gurobi Staff

    Hi Jose,

    I am not sure whether I understand your problem correctly. But you might be not aware of the following:
    When you generate a model and optimize it in a first step and then you add additional variables and/or constraints in a second step, the model is only expanded, no fixations are done. If then the model is optimized, the solution of the first step could be used as a starting solution but all variables are free to be changed. Hence, it is perfectly possible that the optimal solution in the second step has completely different variable values compared to the optimal solution in the first step.

    If you want to solve the expanded model based on the solution values of the initial model, you need to fix the variables to their optimal value. You could do this for example by fixing the variables bounds of the previous period directly after the for loop is started:

    for t in range(1, 4):
    if m.Status == gp.GRB.OPTIMAL:
      X[t-1].lb = X[t-1].X
      X[t-1].ub = X[t-1].X
    X_backup[t-1].lb = X_backup[t-1].X
      X_backup[t-1].ub = X_backup[t-1].X
    ...

    Let me know if this does not address your issue,
    Marika

    0
  • Jose Navarro
    • Gurobi-versary
    • First Comment
    • First Question

    Hi Marika,

    As you mentioned, I was not aware that when adding new steps, the model did not do fixations, but expanded. 

    Your input has helped me to solve the expanded model based on the initial solution, which is what I wanted to do although I may not have been clear before.

    Thank you very much for taking the time to clarify my question, it has been valuable for me.

    0

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