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

Error gurobipy "__init__() got an unexpected keyword argument 'bounds'"

ユーザーの入力を待っています。

コメント

6件のコメント

  • 正式なコメント
    Simranjit Kaur
    • 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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • Jonasz Staszek
    • Community Moderator
    • Gurobi-versary
    • Thought Leader
    • First Question

    Hi Joana,

    if you want to add a variable using Gurobi Python API, you need to use its syntax.

    Adding a single variable is usually done by the command model.addVar().

    If you use a different modelling package, you need to refer to its documentation.

    Best regards
    Jonasz

    0
  • Joana Domingos
    • Gurobi-versary
    • First Question
    • First Comment

    Hi! Thank you for your quick answer.
    However, i tried the model.addVar() and it gives me this:

    What should i do?

    0
  • Jonasz Staszek
    • Community Moderator
    • Gurobi-versary
    • Thought Leader
    • First Question

    What is your \(model\) object? Is it a gurobipy model?

    It needs to be one, otherwise the method won't work or its behavior could be different to what we expect to see.

    Best regards
    Jonasz

    0
  • Joana Domingos
    • Gurobi-versary
    • First Question
    • First Comment

    My model object is defined as: 

    model = ConcreteModel()
     
    Is it a gurobipy model?
     
    Regards
    Joana
    0
  • Jonasz Staszek
    • Community Moderator
    • Gurobi-versary
    • Thought Leader
    • First Question

    After a brief Google search I see that ConcreteModel() might be a pyomo-specific constructor.

    Are you using pyomo? If yes, I would redirect you to consult pyomo's documentation for further clarifications. Perhaps this section will be of interest.

    If that doesn't help, please share a minimal reproducible example of the code which throws this error.

    Best regards
    Jonasz

    0

投稿コメントは受け付けていません。