Pinned topic How to update values of variables in opl main script
AlexFleischer 270002VCBK1132 PostsACCEPTED ANSWER
Re: How to update values of variables in opl main script2013-12-07T08:52:25Z in response to 6A0Q_Hartioun_Arzoumanian
you may use a scripting Array through the keyword Array or you can use also an OPL array that you have declared before.
The computations will be faster if you do them in OPL like int c[i in R1][j in R2]=a[i][j]+b[i][j];
6A0Q_Hartioun_Arzoumanian 2700066A0Q6 PostsACCEPTED ANSWER
Re: How to update values of variables in opl main script2013-12-07T11:16:23Z in response to AlexFleischer
Yes but whenever I do the following:var src = new IloOplModelSource("project.mod");var def = new IloOplModelDefinition(src);var cplex = new IloCplex();var model = new IloOplModel(def, cplex);var data = new IloOplDataSource("project.dat");var data2 = new IloOplDataElements();
data2.VMMapping = 1; // here I get an error
it says VMMapping doesnot exist.
where VMMapping is a two dimensional array declared in project.mod file as follows:
int VMMapping[v in V][d in D] = ...;