Last change
on this file since 14810 was
14649,
checked in by jkarder, 8 years ago
|
#2205: worked on optimization networks
- added lrp network 3
- fixed bug in distance calculation
- renamed FLP.mod to FLP_1.mod
- activated cma analyzer per default
|
File size:
1.3 KB
|
Line | |
---|
1 | //Capacitated Facility Location Problem:
|
---|
2 |
|
---|
3 | int I = ...;
|
---|
4 | int J = ...;
|
---|
5 | float f[0..(I-1)] = ...; //Kosten Depot i
|
---|
6 | float s[0..(I-1)] = ...; //KAP Depot i
|
---|
7 | float d[0..(J-1)] = ...; //Bedarf Kunde j
|
---|
8 | float c[0..(I-1)][0..(J-1)] = ...; //Wegkosten von i nach j
|
---|
9 |
|
---|
10 | range RI = 0..(I-1);
|
---|
11 | range RJ = 0..(J-1);
|
---|
12 |
|
---|
13 | dvar float+ x[0..(I-1)][0..(J-1)]; //Transportmenge
|
---|
14 | dvar boolean y[0..(I-1)]; //Eröffnung Depot i
|
---|
15 | dvar boolean z[0..(I-1)][0..(J-1)]; //Depot i beliefert Kunde j
|
---|
16 |
|
---|
17 | minimize
|
---|
18 | ( sum ( i in 0..(I-1), j in 0..(J-1) ) ( c[i][j] * x[i][j] ) + sum ( i in 0..(I-1) ) ( f[i] * y[i] ) );
|
---|
19 |
|
---|
20 |
|
---|
21 | subject to
|
---|
22 | {
|
---|
23 | //Für jedes Depot gilt: Ausliefermenge x kann maximal so groß sein wie Depot-KAP y
|
---|
24 | forall ( i in 0..(I-1) )
|
---|
25 | sum ( j in 0..(J-1) ) ( x[i][j] ) <= s[i] * y[i];
|
---|
26 |
|
---|
27 | //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
|
---|
28 | forall ( i in 0..(I-1), j in 0..(J-1) )
|
---|
29 | ( x[i][j] ) == ( d[j] * z[i][j] );
|
---|
30 |
|
---|
31 | //Jeder Kunde muss insgesamt genau den Bedarf d geliefert bekommen:
|
---|
32 | forall ( j in 0..(J-1) )
|
---|
33 | sum ( i in 0..(I-1) ) ( x[i][j] ) == d[j];
|
---|
34 |
|
---|
35 | forall ( j in 0..(J-1) )
|
---|
36 | sum ( i in 0..(I-1) ) ( z[i][j] ) == 1;
|
---|
37 |
|
---|
38 | forall ( i in 0..(I-1) )
|
---|
39 | sum ( j in 0..(J-1) ) z[i][j] <= J * y[i];
|
---|
40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.