Decision Optimization

Decision Optimization

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

 View Only
  • 1.  oplall.jar and cplex.jar in the Same Java Project

    Posted Mon February 23, 2015 08:16 PM

    Originally posted by: mathygirl


    I've built a Java class that generates an lp file from an opl mod file and opl dat files. This involves using functionality in oplall.jar. Once the lp file is created, I have a separate Java class that reads in this lp file and uses only the functionality in cplex.jar. I know that oplall.jar and cplex.jar have different implementations of the IloCplex class,  and I need the IloCplex class implementation to come from cplex.jar. Is it good practice to be using two separate jars in the same Java project? And is there a recommended way to include both jars in the same Java project?


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: oplall.jar and cplex.jar in the Same Java Project

    Posted Wed February 25, 2015 03:29 AM

    Hi,

    could you call oplrun.exe from Java code and  then do the CPLEX Java operations on the generated LP ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: oplall.jar and cplex.jar in the Same Java Project

    Posted Thu February 26, 2015 12:18 PM

    Originally posted by: mathygirl


    Yes, I think that's exactly what I'm going to do. But I would still like to know the following:

    if I'm importing an lp file with the following commands

    IloCplex cplex = new IloCplex();
    cplex.importModel("lpfile.lp");
    IloLPMatrix lp = (IloLPMatrix)cplex.LPMatrixIterator().next();

    ...

    do I get the same functionality for my cplex object from oplall.jar as from cplex.jar? 


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: oplall.jar and cplex.jar in the Same Java Project

    Posted Thu February 26, 2015 02:56 PM

    Yes the cplex objects should behave the same.

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: oplall.jar and cplex.jar in the Same Java Project

    Posted Sat February 28, 2015 04:02 AM

    PS:

    do you know that from a main block in OPL you can do an external java call ?

    So anothher way would be to generate the lp file in the main script and then call your java routine.

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: oplall.jar and cplex.jar in the Same Java Project

    Posted Tue July 14, 2015 03:29 PM

    Originally posted by: IrvL


    This is not true.  See http://www-01.ibm.com/support/docview.wss?uid=swg21569088 .  There are methods in the IloCplex class that are implemented in cplex.jar, but not oplall.jar . There are also methods related to extraction that have significant performance differences between the two implementations.  While at ILOG, I strongly suggested that it would have been better if there were two different packages:  ilog.cplex and ilog.opl.cplex, with ilog.cplex.IloCplex and ilog.opl.cplex.IloCplex classes, which would allow you to easily specify which one you were using.  Maybe one day that will get fixed.

     -Irv Lustig
    Princeton Consultants

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: oplall.jar and cplex.jar in the Same Java Project

    Posted Fri July 17, 2015 06:30 AM

    Hi,

    yes and this is why mathygirl wrote earlier in this thread:

    and I need the IloCplex class implementation to come from cplex.jar.

    Do not hesitate to log a RFE.

    Regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer