sudarsan vs
sudarsan vs

Reputation: 113

what is the error in my code ? I have not set the data already

i was trying to solve this transportation problem in cplex enter image description here

here is my OPL code

int p=...;

int q=...;

range i=1..p;

float a[i];

range j=1..q;

float b[j];

float c[i][j];

dvar boolean x[i][j];

minimize sum(l in i,m in j)x[l][m]*c[l][m];

subject to {

forall (l in i) sum(m in j) x[l][m] <= a[l];

forall (m in j) sum(l in i) x[l][m] >= b[m];

}

enter image description here this is my .dat

I keep getting this error " Data element "a" is already set".

Upvotes: 0

Views: 353

Answers (1)

Alex Fleischer
Alex Fleischer

Reputation: 10059

since you declare a in the .dat you should replace

float a[i];

by

float a[i]=...;

Upvotes: 1

Related Questions