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

Issues when modelling the BEST-WORST criteria weight extraction method

回答済み

コメント

3件のコメント

  • 正式なコメント
    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.
  • Jaromił Najman
    • Gurobi Staff

    Hi Milovan,

    Note that the addGenConstrAbs method has slightly different arguments compared to the addConstr method.

    You should try

    BWM.addConstr(X == gp.abs_(a[f"wb - ebj*w_C{criterion}"]))
    BWM.addConstr(X == gp.abs_(a[f"w_C{criterion} - ejw*ww"]))

    Note that it is not possible to directly model \(X \leq |a|\). To model an inequality with the absolute function, you have to introduce an additional auxiliary variable \(Y\) to model \(X \leq Y\) and \(Y = |a|\).

    On a side note, it is strongly recommended to avoid using names with whitespaces. If possible, you should replace whitespaces by, e.g., '_' or any character you prefer.

    Best regards, 
    Jaromił

    0
  • Milovan Kovač
    • Gurobi-versary
    • First Question
    • First Comment

    Thank you Jaromił. This clarified some things for me.
    Now my model works as intended.

    Best regards,
    Milovan

    0

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