Originally posted by: Rommelds
Daniel,
I'm using the version 12.4
I have a project in Java which calls the .mod file. The Java project contains the data to solve the model. I use de handler to get the data from the project.
However, I also consider a matrix with 60.000 lines and 5 columns!!! This data is uploaded in the .mod from a .txt file.
I use the time limit because sometimes the matrix is too big. So, I stop the model.
I use the following code:
double result = 0.0; IloOplFactory.setDebugMode(
true); IloOplFactory oplF =
new IloOplFactory(); IloOplErrorHandler errHandler = oplF.createOplErrorHandler(System.out); IloOplModelSource modelSource = oplF.createOplModelSource(DATADIR +
"/3D.mod"); IloCplex cplex =
null;
try
{ cplex = oplF.createCplex();
}
catch (IloException e)
{ e.printStackTrace();
} IloOplSettings settings = oplF.createOplSettings(errHandler); IloOplModelDefinition def=oplF.createOplModelDefinition(modelSource,settings); IloOplModel opl=oplF.createOplModel(def,cplex); IloCustomOplDataSource dataSource =
new MyCustomDataSource(oplF,cromossomo,numeroDeTipos,numeroDeCortes,quantidade,base,cuts,X,Y,Z); opl.addDataSource(dataSource); opl.generate();
try
{
if (cplex.solve())
{
//time limit < 120 seconds result = opl.getCplex().getObjValue();
}
else
{
//time limit > 120 seconds result = 0.0;
} ...
The tilim parameter is written in the 3D.mod
#DecisionOptimization#OPLusingCPLEXOptimizer