Originally posted by: ChrisBr
Hello,
Please, be careful at your indices.
For example, in the expression
forall(i in Demands,k in Demandinstances,l in Supplyitems) sum(h in Disastertypes) a[h][k][l]*p[h][i][l]*d1[h][i][k]==d2[i][k][l];
k will iterate in Demandinstances so in 1..10 although a is defined with
int a[h in Disastertypes][i in Demands][l in Supplyitems]
so
int a[h in 1..2][i in 1..6][l in 1..3]
thus, when k becomes > 6, OPL will raise an error "Index out of bound".
Same issue for the expressions:
sum(j in Warehouses,l in Warehouses) q[j][l]<=...
you should write:
sum(j in Warehouses,l in Supplyitems) q[j][l]<=...
I hope this helps,
Chris.
#DecisionOptimization#OPLusingCPOptimizer