Originally posted by: pradeepram80
I do have the tuples defined as you say. In my case, since I'm trying to writeback conflict info, I've the following:
tuple ts {string str1};
string conflicts = ...;
and in post processing, I've the following code:
{ts} oConflicts = {<conflicts>};
and under main, I've the following:
main{
thisOplModel.generate();
if(cplex.solve()){
writeln("Objective ",cplex.getObjValue());
thisOplModel.postProcess();
}
else{
var conflictstr, relaxstr;
conflictstr = thisOplModel.printConflict(); //printconflict() is the only function available from OPL and
//I cant use it in my original model. I can only use it here inside main
//Can you tell me how I can write conflictstr to the string conflicts defined earlier in my model? since
// this does not work
//thisOplModel.conflicts = conflictstr;
//so I've to create another model-newOplModel where I change its data with conflictstr using dataElements;
....
....
newOplModel.generate();
cplex.solve(); //Now i've to do the solve again, in order to run postprocessing. In my original model //settings, I had feasopt set to run both phases but newOplModel doesnt seem to have that setting. There is no way I //can change that setting through code. so the model returns infeasible and doesnt run postprocessing. SCREWED!!:-(
}
}
I cant believe OPL script will be this complicated to accomplish something this straightforward. Surely, I must be missing something...
Pradeep
#DecisionOptimization#OPLusingCPLEXOptimizer