Building my project's path so the jar file is added into the path, this structure works great on a Windows enviroment. But when I do this in Linux, using the corresponding files for this , (the image is actually from my project in linux) I get the following error: "Cannot fin cplex". My java class looks like this:
// Interpret the two files ampl.read("models/diet/diet.mod");// ampl.readData(modelDirectory + "/diet.dat"); //read Run file that connects to oracle ampl.read("models/diet/diet-oracle_verified.run");
// display objective function and diet constraits ampl.expand(ampl.getObjective("Total_Cost")); ampl.expand(ampl.getConstraint("Diet")); // select solver// ampl.setOption("solver", "cplexamp"); ampl.eval("option solver cplex;"); ampl.setOption("cplex_options", "baropt"); // Solve ampl.solve();
//Write results in table// ampl.writeTable("dietFoods");
} finally { ampl.close(); }As you can see, I've tried using cplex and cplexamp, eve ./cplex as I've seen suggested but nothing works. Also if I comment these lines AMPL doesn't find minos either, wich is I think the default solver.
Am I missing a file in my lib folder? How can I make this work?
Thanks in advance for any suggestions,
Andrea B.
Hello community,I have a Java project in which I use AMPL to solve an optimization problem. Im the project I have a folder name lib with all the libraries and files that due to my experience, I need within my project to be independent of outside folders:
Building my project's path so the jar file is added into the path, this structure works great on a Windows enviroment. But when I do this in Linux, using the corresponding files for this , (the image is actually from my project in linux) I get the following error: "Cannot fin cplex". My java class looks like this:
try {// Interpret the two filesampl.read("models/diet/diet.mod");// ampl.readData(modelDirectory + "/diet.dat");//read Run file that connects to oracleampl.read("models/diet/diet-oracle_verified.run");// display objective function and diet constraitsampl.expand(ampl.getObjective("Total_Cost"));ampl.expand(ampl.getConstraint("Diet"));// select solver// ampl.setOption("solver", "cplexamp");ampl.eval("option solver cplex;");ampl.setOption("cplex_options", "baropt");// Solveampl.solve();//Write results in table// ampl.writeTable("dietFoods");} finally {ampl.close();}As you can see, I've tried using cplex and cplexamp, eve ./cplex as I've seen suggested but nothing works. Also if I comment these lines AMPL doesn't find minos either, wich is I think the default solver.
Am I missing a file in my lib folder? How can I make this work?
Thanks in advance for any suggestions,
Andrea B.
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.