Skip to main content

Updating the number of variables and Constraints through For Loop

Answered

Comments

2 comments

  • Official comment
    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.
  • 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

Post is closed for comments.