Originally posted by: Cplex
Now I tried it in a main block as follows:
main {
var K = 92;
var sum = 0.0;
// Create the model and solve it
var cplex = new IloCplex();
var source = new IloOplModelSource("KH 3.mod");
var def = new IloOplModelDefinition(source);
var opl = new IloOplModel(def, cplex);
var data = new IloOplDataSource("KH 3.dat");
opl.addDataSource(data);
opl.generate();
for(var k in 1..K){
for(var l in 1..K| l > k){
for(var n in 1..K| n >l){
z[k] == 0;
z[l] == 0;
z[n] == 0;
cplex.solve();
if (cplex.solve()) {
writeln("OBJ = " + cplex.getObjValue());
} else {
writeln("No solution");
}}}}
// Cleanup
opl.end();
data.end();
def.end();
source.end();
cplex.end();
}
The model runs but then says that there's no solution. I attached both my model and my data file as well as the model file containing the main block.
I really need some help in this case.
Thanks!
#DecisionOptimization#OPLusingCPLEXOptimizer