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