Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  IFTHEN constraints with AND

    Posted Sat July 05, 2014 02:16 PM

    Originally posted by: Nodame


    While solving an LP problem, I am calling cplex solver from C#. I would like to set up an IFTHEN constraint with AND:

    IF (A>=0 AND B>=0), THEN C=0.

     

    Unfortunately, I am getting this error: "Operator '&&' cannot be applied to operands of type ILog.Concert.IConstraint and ILog.Concert.IConstraint .

    I am using:

    cplex.Add( cplex.IfThen( cplex.Ge(A,0) && cplex.Ge(B,0),

    cplex.Eq(C,0)) );

    Is there a way to achieve what I am trying to do?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: IFTHEN constraints with AND

    Posted Sat July 05, 2014 03:19 PM

    Originally posted by: Nodame


    I think     cplex.Add( cplex.IfThen( cplex.And( cplex.Ge(A,0),cplex.Ge(B,0) ),cplex.Eq(C,0)) );

    works better...


    #CPLEXOptimizers
    #DecisionOptimization