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

Updating the number of variables and Constraints through For Loop

回答済み

コメント

1件のコメント

  • Jaromił Najman
    • Gurobi Staff

    Hi Min Lee,

    I think that it is easier to have a list or a dictionary holding multiple yDHT entries instead of directly modifying the tupledict returned by the addVars method.

    You could have a dictionary similar to

    S = {S1: "yHDT defined over scenario S1", S2: "yHDT defined over scenario S2", ...}

    Then, when adding constraints, you can run over all entries in this dictionary and construct the corresponding constraints.

    Best regards, 
    Jaromił

    0

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