Skip to main content

How to remove scenarios from Multi-Scenario Gurobi model or transfer it to a normal single Scenario model?

Comments

2 comments

  • Official comment
    Simranjit Kaur
    Gurobi Staff Gurobi Staff
    This post is more than three 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 why not try our AI Gurobot?.
  • Yuri Pessoa
    Gurobi-versary
    First Comment
    First Question

    For the first question, if you want to delete a scenario after you have called model.optimize() it is not possible. While you are building your model, it is possible to delete a scenario by decreasing the value of NumScenarios attribute.

    For your second question, you can change the model back to a single scenario after the optimization has been completed. Use the model.singleScenarioModel() attribute to change your multi-scenario model to a single scenario.

    In case you use the standard query attributes of Gurobi in a multi-scenario model while not setting the single scenario model attribute, it will only capture the attributes of the base model. In fact, querying a given RHS attribute on a multi-scenario model will return an error if you use the standard constr.RHS

    I hope these may help you.

     

    0

Post is closed for comments.