Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  getDetTime

    Posted 11/07/13 08:40 AM

    Originally posted by: gargius


    Hallo,

    I work with CPLEX over Java and I want to access the deterministic time in Java. It is not possible over

    cplex.getDetTime()

    because this method is not available. Has anybody an idea how I can access this value? Do I have to use an Callback?

     

    Thanks in advance

     

    Best regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: getDetTime

    Posted 11/07/13 09:34 AM

    Hi,

    do you use JAVA or script within OPL ?

    In JAVA on IloCplex you have

    double getDetTime()

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: getDetTime

    Posted 11/07/13 09:49 AM

    Originally posted by: gargius


    I use Java, but when I enter:

    IloCplex cplex = oplF.createCplex();
    cplex.getDetTime();

    The message "The method getDetTime() is undefined for the type IloCplex" occurs.

     

    Thanks

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: getDetTime

    Posted 11/07/13 10:57 AM

    which cplex version do you use ?


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: getDetTime

    Posted 11/07/13 12:03 PM

    Originally posted by: gargius


    I use cplex version 12.5


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: getDetTime

    Posted 11/08/13 02:31 AM

    The CPLEX optimization studio distribution has two different jars: oplall.jar and cplex.jar. Both jars contain an IloCplex class. However, those two classes differ slightly. One such difference is that the oplall.jar:ilog.cplex.IloCplex does not implement the getDetTime() method. If you do not need to use OPL you can switch over to using cplex.jar. The IloCplex class in that jar implements the getDetTime() method.

    If you have to stick with oplall.jar you can try this undocumented way to get the deterministic time (since it is undocumented it may change without further notice between releases):

    cplex.getCplexImpl().getDetTime()


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: getDetTime

    Posted 11/08/13 04:15 AM

    Originally posted by: gargius


    Thank you. Now it works.

    Do you recommend to switch over to cplex.jar?

    I have a model in .mod file and I like the possibility to use OPL to implement the model.

    I looked at some examples to implement the model in Java directly without OPL but it was not so intuitive as with OPL.

    But I want to declare the single elements in my objective function (objElement 1: ..., objElement 2: ...,   .....). At this moment I have the complete elements of the objective function in the post process block to access the single objective value of every element. 

    I don't think it is possible to do this with OPL easier?! I know it is possible with cplex.jar.

     

    Thanks in advance

    regards

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer