Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  cplex log has no time information

    Posted 08/28/13 05:29 AM

    Originally posted by: StevenYAO


    I understand that Cplex Interactive Mode can auto generate log file: "cplex.log" and it shows time information in the log (like "Log started (V12.5.0.0) Wed Aug 28 17:13:36 2013" shown in the below example). But if I use java to call cplex and use cplex.setOut (OutputStream cplexLog = new FileOutputStream("C:/cplex.log", true);  cplex.setOut(cplexLog);) to save the default log, there is no time information display in the log file. How to display the time information? Is there any setting we can use? I do not want to read system time and write it into the log file by my coding. Thanks.

    ***************************************************************************************************************************************************************

    Log started (V12.5.0.0) Wed Aug 28 17:13:36 2013

    Tried aggregator 1 time.
    LP Presolve eliminated 2 rows and 2 columns.
    All rows and columns eliminated.
    Presolve time = 0.05 sec. (0.00 ticks)

    Dual simplex - Optimal:  Objective = 8.0000000000e+000
    Solution time =    0.11 sec.  Iterations = 0 (0)
    Deterministic time = 0.00 ticks  (0.02 ticks/sec)

    Tried aggregator 1 time.
    LP Presolve eliminated 1 rows and 1 columns.
    All rows and columns eliminated.
    Presolve time = 0.00 sec. (0.00 ticks)

    Dual simplex - Optimal:  Objective = 5.0000000000e+000
    Solution time =    0.00 sec.  Iterations = 0 (0)
    Deterministic time = 0.00 ticks  (0.80 ticks/sec)


    Log started (V12.5.0.0) Wed Aug 28 17:17:50 2013

    Tried aggregator 1 time.
    LP Presolve eliminated 1 rows and 1 columns.
    All rows and columns eliminated.
    Presolve time = 0.00 sec. (0.00 ticks)

    Dual simplex - Optimal:  Objective = 1.0000000000e+002
    Solution time =    0.00 sec.  Iterations = 0 (0)
    Deterministic time = 0.00 ticks  (0.80 ticks/sec)

    ***************************************************************************************************************************************************************


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: cplex log has no time information

    Posted 08/28/13 07:46 PM

    The log written through the Java API using setOut contains the same time information that the interactive optimizer displays. Here's an excerpt from the log file of a Java program of mine after I used setOut to divert the output:

    === BEGIN ===

    Found incumbent of value 125.000000 after 0.02 sec. (0.01 ticks)
    Tried aggregator 1 time.
    Reduced MIP has 125 rows, 132 columns, and 996 nonzeros.
    Reduced MIP has 125 binaries, 0 generals, 0 SOSs, and 0 indicators.
    Presolve time = 0.02 sec. (0.22 ticks)
    Probing time = 0.00 sec. (0.03 ticks)

    Tried aggregator 1 time.
    Reduced MIP has 125 rows, 132 columns, and 996 nonzeros.
    Reduced MIP has 125 binaries, 0 generals, 0 SOSs, and 0 indicators.
    Presolve time = 0.00 sec. (0.22 ticks)
    Probing time = 0.00 sec. (0.03 ticks)

    MIP emphasis: balance optimality and feasibility.
    MIP search method: dynamic search.
    Parallel mode: deterministic, using up to 4 threads.
    Root relaxation solution time = 0.03 sec. (1.45 ticks)


            Nodes                                         Cuts/
       Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

    *     0+    0                          125.0000        0.0000      109  100.00%
          0     0        0.0838    79      125.0000        0.0838      109   99.93%
    *     0+    0                           44.0000        0.0838      109   99.81%
          0     0        1.0785    81       44.0000       Cuts: 4      127   97.55%
          0     0        2.0700    74       44.0000    MIRcuts: 1      146   95.30%
    *     0+    0                           37.0000        2.0700      146   94.41%
    *     0+    0                           28.0000        2.0700      146   92.61%
          0     2        2.0700    74       28.0000        3.0606      146   89.07%
    Elapsed time = 0.33 sec. (41.52 ticks, tree = 0.01 MB, solutions = 4)
    *    52+   52                           26.0000        3.0688     1749   88.20%
    *   410+  269                           25.0000        3.0740     7595   87.70%

    ...

      66313 40213    infeasible             25.0000       18.8224  3745532   24.71%
      68238 41268       21.0414    68       25.0000       18.8650  3857870   24.54%
    Elapsed time = 54.49 sec. (33692.62 ticks, tree = 11.31 MB, solutions = 6)
      70132 42332       23.5800    62       25.0000       18.8915  3967229   24.43%
      72217 43458       21.4143    61       25.0000       18.9330  4082770   24.27%

    ...

    === END ===

    I've bolded the timing information. If the excerpt in your question was from the log file, the issue is not that CPLEX omitted time info -- it's that your problem was trivial. The presolver solved the first instance to optimality in 0.05 seconds and the second instance even faster, without ever getting to the branch-and-bound algorithm.

    Paul


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: cplex log has no time information

    Posted 08/28/13 09:27 PM

    Originally posted by: StevenYAO


    Hi, Paul,

    Thanks for your reply. But I think you misunderstood my question maybe because my question is not very clear. What I want the log to show is the system time at the begining of each run. 

    e.g.  "Log started (V12.5.0.0) Wed Aug 28 17:13:36 2013" shown in my example.

    This can be shown in Cplex Interactive Mode auto generated log file "cplex.log". But if I use java to call cplex and use cplex.setOut (OutputStream cplexLog = new FileOutputStream("C:/cplex.log", true);  cplex.setOut(cplexLog);) to save the default log, there is no such time information in the log file.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: cplex log has no time information

    Posted 08/28/13 09:55 PM

    Got it. The only way I know is to read the system lock and write the date/time to the log file's output stream.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: cplex log has no time information

    Posted 08/28/13 10:15 PM

    Originally posted by: StevenYAO


    Hi, Paul, Noted. Thanks!


    #CPLEXOptimizers
    #DecisionOptimization