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

Variables C in .lp file?

回答済み

コメント

2件のコメント

  • 正式なコメント
    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 why not try our AI Gurobot?.
  • Eli Towle
    • Gurobi Staff

    Hi,

    Model.addVars() adds new variables to the model, just like Model.addVar(). Because you don't supply a name to these variables, the default names \( \texttt{C0} \), \( \texttt{C1} \) , etc. are used. The \( \texttt{C} \) stands for "continuous."

    If you want to only add the \( \texttt{x} \) variables to the model, you could define \( \texttt{x} \) as a dictionary with \( \texttt{ x = {}} \), then add the variables you want with individual calls to Model.addVar().

    Also, note that you don't have to explicitly declare \( [0,1] \) bounds when adding binary variables to the model.

    Thanks,

    Eli

    0

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