Originally posted by: 18125514
OK,thanks much!
The model is as follows:
{string} Au = {"a","b"};
{string} Am = {"c","d"};
{string} Ad = {"e","f"};
{string} A =Au union Am union Ad;
int S[A]=[1,1,1,2,2,2];
int m=6;
int n=card(A);
// initialize the 2 dimensional array
execute{
var s = new Array (thisOplModel.A+thisOplModel.S[A]) ;
for( var i in thisOplModel.A){
s[i] = new Array(S[A]);
var a=thisOplModel.S[i]
for(var j=1;j<=a;j++) {
s[i][j]= 123.0;
writeln( s[i][j]);
}
}
}
float f[A][s]=...;
The problem is this:
"A" represents the arc.
"s" represents the fragment in each arc.
The maximum number of s in each arc is S[A].
Now I just want to show s, but s will be affected by A, so I wrote a two-dimensional array with a script. But it doesn't seem to work.
At the same time, s will be used as a subscript to indicate other variables.
Because s is affected by the specific arc, this problem has not solved me well in a week.
Thank you very much for your attention.
#DecisionOptimization#OPLusingCPLEXOptimizer