Originally posted by: CplexUser1453
Hello
I am trying to see if I can implement a decomposition using OPL script and I have run into the following problem: I need to modify non scalar data.
I have found examples of how to modify scalar data (http://pic.dhe.ibm.com/infocenter/cosinfoc/v12r4/index.jsp, https://www.ibm.com/developerworks/community/forums/html/topic?id=243675ee-3045-41b5-ada9-d1613686b44c&ps=25) but somehow I am incapable of modifying non scalar stuff. The link above says :
"Only external data can be modified by script. [...] So you would need to create a .dat file that contains the data to update"
However, I am getting an error when supplying the data that is supposed to be updated. Here is a very simple example :
var m1Source = new IloOplModelSource("model.mod");
var m1Cplex = new IloCplex();
var m1Def = new IloOplModelDefinition(m1Source);
var m1Opl = new IloOplModel(m1Def,m1Cplex);
var defaultData = new IloOplDataSource("defaultData.dat");
var subProblemData = new IloOplDataSource("subProblemData.dat");
m1Opl.addDataSource(defaultData);
m1Opl.addDataSource(subProblemData);
I get an error on the last line that the data element that I want to update has already been defined ("La donnée elementaire "X" a déjà été définie.)
subProblemData.dat contains the following data :
X = [1, 2, 3, 4];
while the original data is a
{int} X
initialized with values [1, 2, 3, 4,5,6]
(Obviously, my example is just an illustration and may not make much sense by itself - what I am really trying to do is decomposing a large MILP problem that is defined in a single .mod file. The decomposition requires updating the non scalar data and I would like to do it without touching the .mod file)
Is there any way to solve this problem, or what I am trying to do is not possible with OPL script?
Thanks a lot!
#DecisionOptimization#OPLusingCPLEXOptimizer