Originally posted by: SystemAdmin
>
> I tried to implement a linear model by Eclipse using API.
Which API?
> Although the solution status is optimal, there is an error "Concert Error: ilog.cplex.IloCplex$UnknownObjectException: CPLEX Error: object is unknown to IloCplex" when output the decision variable. Besides, the value of decision variables does not satisfy the constraint. (It's weird....)
I don't know that this applies to other APIs, but in the Java API you need to be careful to distinguish between IloCplexModeler.le() and IloCplexModeler.addLe() (and similarly for ge/addGe and eq/addEq). The first method in each pair creates and returns a constraint
but does not add it to the model; the second method in each pair also adds it to the model.
/Paul
Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
#CPLEXOptimizers#DecisionOptimization