添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
  • Marketplace
  • Marketplace
  • Limited-Time Offer: 50% off IBM TechXchange Conference 2025

    IBM’s largest technical learning event is back October 6-9 in Orlando, FL

    Hello everyone,

    I have developed a model and one of the constraint is based on the logic of "If..Then constraint " that I have modeled in MIP ( You can see tha part of the code in the figure below).
    The problem is when I wanted to impliment this code in CPLEX, the program didn't autorize to write the decision varible like this way.

    Is there any solution, to resolve this problem ?
    If there is someone who can help me to solve this, I will be grateful.

    Best regards,


    ------------------------------
    Khaoula
    ------------------------------

    #DecisionOptimization Hi,

    you should use logical constraints and not use decision variables in slicing:

    int I=3;
    dvar int w1 in 0..1;
    dvar int L[1..10][1..10] in 0..10;

    subject to
    {
    forall(j in 1..3,N in 1..I) (L[N][j]>=1)=> (w1==1);
    }

    works fine

    regards

    ------------------------------
    ALEX FLEISCHER
    ------------------------------

    Original Message Original Message:
    Sent: Tue September 29, 2020 05:52 AM
    From: Khaoula EL MHAMDI
    Subject: How to model "If.. Then constraint in MIP with CPLEX

    Hello everyone,

    I have developed a model and one of the constraint is based on the logic of "If..Then constraint " that I have modeled in MIP ( You can see tha part of the code in the figure below).
    The problem is when I wanted to impliment this code in CPLEX, the program didn't autorize to write the decision varible like this way.

    Is there any solution, to resolve this problem ?
    If there is someone who can help me to solve this, I will be grateful.

    Best regards,


    ------------------------------
    Khaoula
    ------------------------------

    #DecisionOptimization
    Original Message Original Message:
    Sent: Tue September 29, 2020 01:22 PM
    From: ALEX FLEISCHER
    Subject: How to model "If.. Then constraint in MIP with CPLEX

    Hi,

    you should use logical constraints and not use decision variables in slicing:

    int I=3;
    dvar int w1 in 0..1;
    dvar int L[1..10][1..10] in 0..10;

    subject to
    {
    forall(j in 1..3,N in 1..I) (L[N][j]>=1)=> (w1==1);
    }

    works fine

    regards

    ------------------------------
    ALEX FLEISCHER

    Original Message:
    Sent: Tue September 29, 2020 05:52 AM
    From: Khaoula EL MHAMDI
    Subject: How to model "If.. Then constraint in MIP with CPLEX

    Hello everyone,

    I have developed a model and one of the constraint is based on the logic of "If..Then constraint " that I have modeled in MIP ( You can see tha part of the code in the figure below).
    The problem is when I wanted to impliment this code in CPLEX, the program didn't autorize to write the decision varible like this way.

    Is there any solution, to resolve this problem ?
    If there is someone who can help me to solve this, I will be grateful.

    Best regards,


    ------------------------------
    Khaoula
    ------------------------------

    #DecisionOptimization

    Additional
    Resources

    Discover these carefully selected resources to dive deeper into your journey and unlock fresh insights

    Office

    If you need immediate assistance please contact the Community Management team

    [email protected]

    Monday - Friday: 8AM - 5 PM MT

    Quick Links

    About Us

    Terms of Use

    Community Netiquette

    Sitemap

  • Marketplace
  • Marketplace
  •