Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  How to get solution time?

    Posted 04/27/08 10:22 PM

    Originally posted by: SystemAdmin


    [wassama said:]

    Hi, I'm writing code in JAVA and trying to get solution time by using cplex.getTime. But I can not compile it, I got an error message as below;

    /home/.../....java:364: cannot find symbol
    symbol  : method getTime()
    location: class ilog.cplex.IloCplex
            pw.println(" Solution time = " + cplex.getTime());
                                                  ^
     
    This is my code:

    import ilog.concert.;
    import ilog.cplex.
    ;
    import java.io.*;

    ....

    if ( cplex.solve() ) {
       
        File outFile;
        PrintWriter pw;
            outFile = new File("output.txt");
            if (! outFile.exists()) {
      pw = new PrintWriter(new BufferedWriter(new FileWriter
    (outFile)));
     
            pw.println(" Optimal Value = " + cplex.getObjValue());
           
            pw.println(" Solution time = " + cplex.getTime());
            pw.println(" Solution status = " +cplex.getStatus());

    .....

    }

    Have anyone can help me to solve this problem? Do we have other commands to get the solution time?

    Thanks!


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: How to get solution time?

    Posted 04/28/08 04:54 PM

    Originally posted by: SystemAdmin


    [alain.chabrier said:]

    In java, you might use Java system class to control times :

    See
    System.currentTimeMillis

    Hope this helps,

    Alain
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: How to get solution time?

    Posted 04/28/08 08:22 PM

    Originally posted by: SystemAdmin


    [wassama said:]

    Thank you.
    #CPLEXOptimizers
    #DecisionOptimization