Skip to main content

How to use a dict for .start?

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.
  • Riley Clement
    • Gurobi Staff

    Hi Dejan,

    You could set the .Start attribute with the following code:

    for key, value in start_dict.items():
       tyredeg[key].Start = value

    However Start values are only valid for integer (including binary) variables, so this code will not have the effect you want it to.

    We do have PStart which can be used with continuous variables (the values must be provided for every variable), but it also needs to be used in conjunction with DStart which is related to constraints.

    - Riley

    0

Post is closed for comments.