Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

why the method eq of IloCplex does not work?

  • 1.  why the method eq of IloCplex does not work?

    Posted 11/12/17 10:00 PM

    Originally posted by: Fangxia H


    Hi,everyone,

    I use Java programming and  the version of  Cplex is 12.7.1.

    I found that   using  eq() to  add equality constraint didn't work ,but addEq() did.

     

    I wonder why this happens?

    what difference between eq() and addEq() is?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: why the method eq of IloCplex does not work?

    Posted 11/13/17 01:32 AM

    From the reference documentation:

    eq():

    Creates and returns a range forcing the specified value to be equal to the specified numeric expression.

    addEq():

    Creates and returns a range initialized to represent the equality of the specified value and expression.

    The range is added to the invoking model; that is, this method modifies the current model.

    So, as you can see, the former only creates an object while the latter also adds that object to the model. I am not sure what you mean by "does not work" but I guess you mean that the equation is not added to the model. As you can see from the reference documentation, this is intended behavior.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: why the method eq of IloCplex does not work?

    Posted 11/13/17 02:46 AM

    Originally posted by: Fangxia H


    Thanks, I mistakenly looked at the cplex reference documentation for the previous version. So I thought they were the same. Thanks again for your replyLaughing roll


    #CPLEXOptimizers
    #DecisionOptimization