Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Cplex.getCplexTime() - Gives wrong value

    Posted 07/15/19 03:24 AM

    Originally posted by: Nguyenducduy


    Dear friends,

    I used  function Cplex.getCplexTime() to get running time from CPLEX 12.9.
    My model takes 7s23 to run. However, the value of this function is 268462.234.

    I also used the code as below and the value is 0. How can I get right value: 7s23. 
    Thank you very much. 

    float temp;
    execute{
    var before = new Date();
    temp = before.getTime();
    }
    // solve the model
    execute{
    var after = new Date();
    writeln("solving time ~= ",after.getTime()-temp);
    }
    
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Cplex.getCplexTime() - Gives wrong value

    Posted 07/25/19 05:52 AM

    As you can read in the documentation, function getCplexTime() returns a time stamp, not the elapsed time. So you have to do the same thing as with Date in your code: safe the starting time stamp and later subtract that from the ending time stamp.

    I don't know why your code with Data does not work. It works fine here.


    #CPLEXOptimizers
    #DecisionOptimization