Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  OPL Java API RuntimeException

    Posted 04/04/08 12:27 AM

    Originally posted by: SystemAdmin


    [Lara said:]

    Hi all,

    I use OPL Java API for solving MILP problems. I use given .mod and .dat files, the java code generates the run configuration and solves the given problem. This part of the code works correctly.

    The Java code is the following:

        [font=Arial]IloOplFactory myFactory = new IloOplFactory();
          IloCplex cplex = myFactory.createCplex();
          IloOplRunConfiguration runConf = myFactory.createOplRunConfiguration(mod, data);
          runConf.setCplex(cplex);
          runConf.getOplModel().generate();

          if (cplex.solve()) {... processing solution data...}[/font]

    The code ends with the following lines:

        [font=Arial]try{ runConf.end();}catch(Exception e){e.printStackTrace();}
          try{ myFactory.end();}catch(Exception e){e.printStackTrace();}[/font]

    In case of some (.mod, .dat) files I get the following exception during the running of the code:

        [font=Arial]java.lang.RuntimeException: internal error (Please notify Ilog)
          at ilog.opl.opl_wrapJNI.IloOplRunConfiguration_end(Native Method)
          at ilog.opl.IloOplRunConfiguration.end(IloOplRunConfiguration.java:91)
          at my.test.pack.My_first.<init>(My_first.java:80)[/font]

    The problem is something with the end() method, but I don't have any idea what could it be! I'm not sure if I really need this method, or not! I know that it is for memory management, but I don't know the consequences of not using this method! Does anybody have an idea about this problem?

    Thanks for your help,
    Ildiko
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: OPL Java API RuntimeException

    Posted 04/10/08 08:32 AM

    Originally posted by: SystemAdmin


    [vblanchard said:]

    Hi,

    indeed calling end() on the run configuration or the OPL factory is to free memory when you no longer need the model and data you were working with.
    The code extract seems fine and the error you're getting may be specific to the .mod/.dat. We tried to reproduce based on the code extract you provided and couldn't.
    Are you working with the latest patch of OPL 5.5.1 ?
    We'd be happy to look into this in more detail if you can share your java code as well as a model that reproduces this error.

    --
    Veronique

    #DecisionOptimization
    #OPLusingCPLEXOptimizer