Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2205_OptimizationNetworks/HeuristicLab.Problems.FacilityLocation.CplexSolver/3.3/FLP_2.mod @ 16147

Last change on this file since 16147 was 14895, checked in by jkarder, 8 years ago

#2205: worked on optimization networks

  • added lrp networks (4, 5)
  • fixed lrp evaluation
  • updated flp models
  • updated to cplex 12.7
File size: 1.3 KB
Line 
1//Capacitated Facility Location Problem:
2 
3int I = ...;
4int J = ...;
5float f[0..(I-1)] = ...;        //Kosten Depot i
6float s[0..(I-1)] = ...;        //KAP Depot i
7float d[0..(J-1)] = ...;        //Bedarf Kunde j
8float c[0..(I-1)][0..(J-1)] = ...;    //Wegkosten von i nach j
9
10range RI = 0..(I-1);
11range RJ = 0..(J-1);
12 
13dvar float+ x[0..(I-1)][0..(J-1)];    //Transportmenge
14dvar boolean y[0..(I-1)];       //Eröffnung Depot i
15dvar boolean z[0..(I-1)][0..(J-1)];   //Depot i beliefert Kunde j
16
17execute
18 {
19  cplex.threads=1;
20 }
21 
22minimize
23( sum ( i in 0..(I-1) ) ( f[i] * y[i] ) );
24
25
26subject to
27{
28  //Für jedes Depot gilt: Ausliefermenge x kann maximal so groß sein wie Depot-KAP y
29  forall ( i in 0..(I-1) )
30    sum ( j in 0..(J-1) ) ( x[i][j] ) <= s[i] * y[i];
31 
32  //Die Ausliefermenge x kann maximal so groß sein wie der Bedarf des Kunden und es kann nur ausgeliefert werden, wenn das Depot eröffnet wird
33  forall ( i in 0..(I-1), j in 0..(J-1) )
34    ( x[i][j] ) == ( d[j] * z[i][j] );
35 
36  //Jeder Kunde muss insgesamt genau den Bedarf d geliefert bekommen:
37  forall ( j in 0..(J-1) )
38    sum ( i in 0..(I-1) )  ( x[i][j] ) == d[j];
39 
40  forall ( j in 0..(J-1) )
41    sum ( i in 0..(I-1) ) ( z[i][j] ) == 1;   
42
43  forall ( i in 0..(I-1) )
44    sum ( j in 0..(J-1) ) z[i][j] <= J * y[i];
45}
Note: See TracBrowser for help on using the repository browser.