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

How to Assign a Value to a Decision Variable? + How to Constrain for a Subset of Variables

回答済み

コメント

2件のコメント

  • 正式なコメント
    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.
  • Mario Ruthmair
    • Gurobi Staff

    Hi,

    Why isn't SoC[0,0]+SoC[1,0] = 0.1 when it seems like SoC[0,1] was successfully assigned in initial value of 0.1 in the model?

    You set SoC[0,0] = 0.1.
    Then, you set SoC[0,0] = SoC[1,0]. This implies that also SoC[1,0] = 0.1, so the sum is of course 0.2.

    In the definition of your constraints it seems you forgot to add the "increment" in the updatedSoC constraints.

    I am not sure what exactly you want to model with your schedule-variables.
    If you want to know how to write constraints with sums of variables, then you should consider our documentation, tutorials, and examples, e.g.:

    Best regards,
    Mario

    0

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