Originally posted by: John85655
Hi
int cut = ...;
int i = ...;
//product
int j = ...;
//machine
int k = ...;
//process
int l = ...;
//location range Cut = 1..cut;
//process cut range ATL = cut+1..j;
//process ATL range S = 1..i;
//product range range T = 1..j;
//machine range range Standort = 1..l;
//location range
float h [ 1..i][1..k]=...;
//processes required by a product
float d [ 1..i][1..k] = ...;
//demand of product s on a certain process
int feasibility[ 1..i][ 1..j] = ...;
//feasibility of a product on a machine {0,1}
float cf[ 1..j] = ...;
//fix costs
float cv[1..i][1..j]=...;
//variable costs
int cap [ 1..i][ 1..j]=...;
//capacity of product s on machine t dvar
float costCut;
//costs for process Cut dvar
float costATL;
//costs for process ATL dvar int+ x[ 1..i][ 1..j];
//number of parts of product s on machine t dvar
float cost;
//costs minimize cost; subject to
{ forall(s in S, t in T)
{ cost == costCut+costATL; costCut==(sum(s in S)sum(t in Cut)((cv[s][t]*x[s][t]+ cf[t]))); costATL==(sum(s in S)sum(t in ATL)((cv[s][t]*x[s][t]+ cf[t])));
}
/**product s can just get produced on a machine if the feasibility is equal to zero**/ forall (t in T, s in S, a in Standort)
if (feasibility[s][t] ==0) x[s][t] ==0;
/**If a part does not require the process Cut, then x equals =0**/ forall (s in S, t in Cut)
if (h[s][1] ==0) x[s][t] ==0;
/**The amount of product s for the process Cut on the feasibile machine has to be equal to the demand**/ forall (s in S)
if (h[s][1] ==1) sum(t in Cut)x[s][t]== d[s][1];
/**If a part does not require the process ATL, then x equals =0**/ forall (s in S, t in ATL)
if(h[s][2] ==0) x[s][t] ==0;
/**The amount of product s for the process ATL on the feasibile machine has to be equal to the demand**/ forall (s in S)
if (h[s][2] ==1) sum(t in ATL)x[s][t]== d[s][2];
/**Machine capacity restriction**/ forall(t in T, s in S) sum(s in S)(x[s][t])<=cap[s][t];
}
further information:
-
machine 1 is located in A
-
machine 2 is the same machine like machine 1 but located in B
-
machine 3 is the same machine like machine 1 an 2 but located in C
-
machine 4 is another machine located in A
-
machine 5 is the same machine like machine 4 but located in B
-
machine 6 is the same machine like machine 4 an 5 but located in C
-.....
machine 123 has to be located in the same location (A,B,C) for all products.
allowed solution
[0 400 0 0 0 0 0 0 0 0 0 0] [0 0 0 300 0 0 0 0 0 300 0 0] [0 200 0 0 0 0 0 0 0 200 0 0]
not allowed solution of x:
[0 400 0 0 0 0 0 0 0 0 0 0] [0 0 0 300 0 0 0 0 0 300 0 0] [200 0 0 0 0 0 0 0 0 0 200 0]
Does anyone has an idea how to built this restriction?
I do not have an extra array for the location because i want to write it out in an excle file.
thanks for your help,
john
#CPLEXOptimizers#DecisionOptimization