-1

I have a mathematical model that I'm trying to solve it by exporting Cplex library to java. Every thing was alright till I imported my full project to another computer. Cplex solved the mathematical model but now I want to see my variables excel file in my project file. I think I have written the related part of code that exports the excel solution file to my project file correctly,is there any possibility that the excel file to be imported to another location? Here is the piece of code after and before the "solve" part.

cplex.exportModel("model.lp");
cplex.setParam(IloCplex.BooleanParam.NumericalEmphasis, true);
cplex.setParam(IloCplex.Param.MIP.Display, 0);
//solve
if (cplex.solve()){
    System.out.println("The min of total weighted completion times is equal to: " + cplex.getObjValue()+"\n");
    cplex.writeSolution("model_solution.sol");
    System.out.println("Solution status = " + cplex.getStatus());
}
Michał Turczyn
  • 32,028
  • 14
  • 47
  • 69
sorour
  • 49
  • 6
  • It's not clear what you are asking here. How exactly is your code snippet related to Excel? There doesn't seem to be any connection at all.... – rkersh May 03 '18 at 22:00
  • As you can see at the firs line of the code : cplex.exportModel("model.lp"), in order to see my mathematicle moedel in a writen and more understandable way, I tell the java to export my model to a note file. There will be another piece of code that makes an excel file from all of the varibles of the problem in a spreadsheet that you can see all the results of the cplex there in case the problem is feasible. – sorour May 03 '18 at 22:15
  • There is nothing built-in to the CPLEX Java API that provides this kind of functionality. Perhaps you want to look at https://stackoverflow.com/questions/1516144? – rkersh May 03 '18 at 22:19

1 Answers1

0

I finally found the error. When I imported the package to the other computer there was a default work space that was deleted before, so I create a new work space. Furthermore, about the excel file I should say this part of code: cplex.writeSolution("model_solution.sol") creates a file with the extension of “.sol” that you can either open it with Microsoft Excel. The file’s location is in your work space . I always use this method to see all the variable types in a compact way. I strongly recomend you to try it. – sorour 16 mins ago delete

sorour
  • 49
  • 6