Originally posted by: girljasmine
Please Help me
I have a model ,how to build in the CPLEX Optimization Studio??
Consider a supply chain network G =(N, A) , where N
is the set of nodes and A is the set of arcs. Here, N is
composed by the set of suppliers S , facilities F and
customers C .
How to write the set in the OPL?
the math model is in the attach file.
I try to build the model in the below:
but I do not know where goes wrong.Plese help me~
int PRODUCTS=...;
range p=1..PRODUCTS;
int ll=...;
range L=0..ll;
int n=...;
range node=1..n;
tuple edge{
int i;
int j;
}
setof(edge)Edges={<i,j>|ordered i ,j in node};
int d
i in node[p]=...;//i is c
int s
i in node[p]=...;//I IS S
int c
Edges[p]=...;
int f
j in node=...;//j is F
int u
j in node=...;//j is F
int r
j in node[p]=...;//j is F
int l
j in node[p]=...;//j is F
int g
j in node=...;
dvar boolean y
j in node;
dvar int x
Edges[p];
dvar int+ z
j in nodein L;
minimize sum(j in node)f[J]*y[J]+sum(J in N:j==J.F)g[J]*z[J]
+sum(P in p,<i,j>in Edges)c
<i,j>[P]*x
<i,j>[P]+sum(P in p,J in N:j==J.F)l[J][P]*sum(I in N:i==I.S)x[I][J][P];
subject to{
forall(j in node,P in p)
three:
sum(<i,j>in node)x
<i,j>[P]-sum(I in N:i==I.C)x[J][I][p]==0;
forall(J in N:j==J.C,P in p)
four:
sum(I in N:i==I.F)x[I][J][P]==d[J][P];
forall(I in N:i==I.S,P in p)
five:
sum(J in N:j==J.F)x[I][J][P]<=s[I][P];
forall(J in N:j==J.F)
six:
sum(P in p)r[J][P]*sum(I in N:i==I.S)x[I][J][P]<=u[J]*y[J];
forall(J in N:j==J.F)
six:
sum(P in p)r[J][P]*sum(I in N:i==I.S)x[I][J][P]<=u[J]*y[J];
forall(J in N:j==J.F)
seven:
z[J]<=y[J]*L;
}
#DecisionOptimization#OPLusingCPLEXOptimizer