Skip to main content

Forming a model inside a function

Answered

Comments

4 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 Iason,

    I think we'll need to see some code... both the function where you create the model, and where you call it.

    - Riley

    0
  • Iason Liagkas
    • Gurobi-versary
    • Detective
    • Thought Leader

    Hi Riley I found out my bug. Instead of writing SPmodel.optimize() I should write a subproblem.optimize() since the SPmodel is lying inside the function, while the subproblem is the variable that the function passes the model. Sorry for the confusion.

    Kind regards 
    Iason

    0
  • Riley Clement
    • Gurobi Staff

    No problem, well done on spotting it.

    - Riley

    0

Post is closed for comments.