Originally posted by: yipingfang
Hello, guys, does anybody know what's the difference between the following two declaration codes:
Part One:
var masterDef = thisOplModel.modelDefinition;
var masterData = thisOplModel.dataElements;
var masterOpl = new IloOplModel(masterDef, cplex);
masterOpl.addDataSource(masterData);
masterOpl.generate();
var subSource = new IloOplModelSource("sub_MP.mod");
var subDef = new IloOplModelDefinition(subSource);
var subData = new IloOplDataSource("test_subMP.dat");
var subCplex = new IloCplex();
var subOpl = new IloOplModel(subDef, subCplex);
subOpl.addDataSource(subData);
subOpl.generate();
Part Two:
var masterDef = thisOplModel.modelDefinition;
var masterData = thisOplModel.dataElements;
var masterOpl = new IloOplModel(masterDef, cplex);
masterOpl.addDataSource(masterData);
masterOpl.generate();
var subSource = new IloOplModelSource("sub_MP.mod");
var subDef = new IloOplModelDefinition(subSource);
var subData = new IloOplDataSource("test_subMP.dat");
var subOpl = new IloOplModel(subDef, cplex);
subOpl.addDataSource(subData);
subOpl.generate();
The only difference is the definition of IloCplex() for subModel. I find that this difference can lead to completely different result. Is anyone know why? Thanks!
#DecisionOptimization#OPLusingCPLEXOptimizer