0

In my model, first I calculate the number of ports in which ship drop the cargo

forall(i in 1..N,j in k+1..N)
z[i][j]==sum(z in k..N-1)z*dr[i][j][z];

Then I want to use this number as the index of "t",in the form of

t[z[i][j]] 

I'm faced with

error:5002 q1 is not convex

How I can solve this problem?

4

1 回答 1

-1

How to use a decision variable as an index with CPLEX ?

range r=1..5;

float value[r]=[2,3,4.5,1,0];
dvar int i in 1..5;

maximize sum(k in r) value[k]*(k==i);
subject to
{

}

execute
{
writeln("i=",i);
}
于 2019-01-23T09:55:03.217 回答