Originally posted by: aaapb
Hi,
Thanks for your reply. I've tried your suggestion but I got a mismatch error. However, I find another way to access de cplex model with this code:
public double[] getMoreInfo(IloOplModel subModelOpl)
{ IloCplex primal;
try{
primal= subModelOpl.getCplex();
…
And when I write these lines:
IloCplex.Status status=primal.getStatus();
System.out.println("CPLEX status: "+ status);
System.out.println("obj="+primal.getObjValue());
I can get the information about the status and the objective value but I can't access the variables values or apply dualFarkas function (primal.dualFarkas(farkasConstraints, farkasValues)). In the first case it doesn't recognize the variable and in the second I get:
java.lang.RuntimeException: internal error: bad cast
at ilog.concert.cppimpl.IloConcertUtils.ToCppIloConstraint(IloConcertUtils.java:223)
at ilog.concert.cppimpl.IloConcertUtils.ToCppIloConstraintArray(IloConcertUtils.java:371)
at ilog.cplex.IloCplex.dualFarkas(IloCplex.java:17915)
at javaRay.Ray.getMoreInfo(Ray.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at ilog.opl.IloOplExternalCall.callJava(IloOplExternalCall.java:196)
Best regards,
Ana
#DecisionOptimization#OPLusingCPLEXOptimizer