Material hoisting code problem

Archive of Gamsworld Google Group
Post Reply
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Material hoisting code problem

Post by Archiver »


Hi, i have some problems with GAMS code:

1 *Optimization of material hoisting operations and storage locations in mul
ty-storey building construction
2 OPTIONS
3 MIP = CPLEX;
4
5 SETS
6 j material /1*10/
7 l deponijske etaže /1*8/
8 k celice /1*5/
9 m etaže /1*30/;
10
11 PARAMETERS
12 Q(j) potreba materiala j v prostoru m [kg]
13 Ch(j) strošek horizontalnega transporta materiala j [EUR-m-kg];
14
15 Q('1')=2000;
16 Q('2')=1500;
17 Q('3')=6000;
18 Q('4')=1500;
19 Q('5')=4000;
20 Q('6')=3000;
21 Q('7')=2500;
22 Q('8')=1000;
23 Q('9')=500;
24 Q('10')=700;
25
26 Ch('1')=20;
27 Ch('2')=22.5;
28 Ch('3')=15;
29 Ch('4')=23;
30 Ch('5')=10;
31 Ch('6')=10;
32 Ch('7')=23;
33 Ch('8')=14;
34 Ch('9')=15;
35 Ch('10')=16;
36
37 TABLE
38 D(l,k) razdalja od celice k do tovornega dvigala v etaži prostora l [m]
39 1 2 3 4 5
40 1 10 15 20 15 10
41 2 10 15 20 15 10
42 3 10 15 20 15 10
43 4 10 15 20 15 10
44 5 10 15 20 15 10
45 6 10 15 20 15 10
46 7 10 15 20 15 10
47 8 10 15 20 15 10;
48
49 TABLE
50 C1(l,j) strošek vertikalnega transporta materiala j do prostora l [EUR-kg]
51 1 2 3 4 5 6 7 8 9 10
52 1 15 20 13 20 7 7 26 11 12 13
53 2 16.2 21.2 14.2 21.2 8 8.2 27.2 12.2 13.2 14.2
54 3 17.4 22.4 15.4 22.4 9.4 9.4 28.4 13.4 14.4 15.4
55 4 18.6 23.6 16.6 23.6 10.6 10.6 29.6 14.6 15.6 16.6
56 5 19.8 24.8 17.8 24.8 11.8 11.8 30.8 15.8 16.8 17.8
57 6 21 26 19 26 13 13 32 17 18 19
58 7 22.2 27.2 20.2 27.2 14.2 14.2 33.2 18.2 19.2 20.2
59 8 23.4 28.4 21.4 28.4 15.4 15.4 34.4 19.4 20.4 21.4
;
60
61 TABLE
62 C2(m,j) strošek vertikalnega transporta materiala j do etaže m [EUR-kg]
63 1 2 3 4 5 6 7 8 9 10
64 1 15 20 13 20 7 7 26 11 12 13
65 2 16.2 21.2 14.2 21.2 8 8.2 27.2 12.2 13.2 14.2
66 3 17.4 22.4 15.4 22.4 9.4 9.4 28.4 13.4 14.4 15.4
67 4 18.6 23.6 16.6 23.6 10.6 10.6 29.6 14.6 15.6 16.6
68 5 19.8 24.8 17.8 24.8 11.8 11.8 30.8 15.8 16.8 17.8
69 6 21 26 19 26 13 13 32 17 18 19
70 7 22.2 27.2 20.2 27.2 14.2 14.2 33.2 18.2 19.2 20.2
71 8 23.4 28.4 21.4 28.4 15.4 15.4 34.4 19.4 20.4 21.4
72 9 24.6 29.6 22.6 29.6 16.6 16.6 35.6 20.6 21.6 22.6
73 10 25.8 30.8 23.8 30.8 17.8 17.8 36.8 21.8 22.8 23.8
74 11 27 32 25 32 19 19 38 23 24 25
75 12 28.2 33.2 26.2 33.2 20.2 20.2 39.2 24.2 25.2 26.2
76 13 29.4 34.4 27.4 34.4 21.4 21.4 40.4 25.4 26.4 27.4
77 14 30.6 35.6 38.6 35.6 22.6 22.6 41.6 26.6 27.6 28.6
78 15 31.8 36.8 29.8 36.8 23.8 23.8 42.8 27.8 28.8 29.8
79 16 33 38 31 38 25 25 44 29 30 31
80 17 34.2 39.2 32.2 39.2 26.2 26.2 45.2 30.2 31.2 32.2
81 18 35.4 40.4 33.4 40.4 27.4 27.4 46.4 31.4 32.4 33.4
82 19 36.6 41.6 34.6 41.6 28.6 28.6 47.6 32.6 33.6 34.6
83 20 37.8 42.8 35.8 42.8 29.8 29.8 48.8 33.8 34.8 35.8
84 21 39 44 37 44 31 31 50 35 36 37
85 22 40.2 45.2 38.2 45.2 32.2 32.2 51.2 36.2 37.2 38.2
86 23 41.4 46.4 39.4 46.4 33.4 33.4 52.4 37.4 38.4 39.4
87 24 42.6 47.6 40.6 47.6 34.6 34.6 53.6 38.6 39.6 40.6
88 25 43.8 48.8 41.8 48.8 35.8 35.8 54.8 39.8 40.8 41.8
89 26 45 50 43 50 37 37 56 41 42 43
90 27 46.2 51.2 44.2 51.2 38.2 38.2 57.2 42.2 43.2 44.2
91 28 47.4 52.4 45.4 52.4 39.4 39.4 58.4 43.4 44.4 45.4
92 29 48.6 53.6 46.6 53.6 40.6 40.6 59.6 44.6 45.6 46.6
93 30 49.8 54.8 47.8 54.8 41.8 41.8 60.8 45.8 46.8 47.8;
94
95 VARIABLE
96 T skupni transportni strošek;
97
98 BINARY VARIABLE
99 DELTAjm odločitvena spremenljivka 0 material j ni potreben v etaži m 1
material j potrebujejo v etaži m
100 Xjlk odločitvena spremenljivka 1 material j je deponiran v celici k v pros
toru m
101 GAMAjlkm odločitvena spremenljivka 1 pomeni da je bil material j iz celice
k (v prostoru l) dostavljen do etaže m ;
102
103 SCALAR
104 N veliko Å¡tevilo /999999999999999/;
105
106 EQUATIONS
107 ENACBA7
108 ENACBA8
109 ENACBA9
110 ENACBA10
111 NAMENSKAFUNKCIJA;
112
113 ENACBA7..
114 SUM(j,Xjlk)=E=1;
115
116 ENACBA8..
117 SUM((l,k),Xjlk)=L=1;
118
119 ENACBA9..
120 N*SUM(j,Q(j))=G=DELTAjm;
121
122 ENACBA10..
123 N*(2-Xjlk-DELTAjm)+GAMAjlkm=G=1;
124
125
126 NAMENSKAFUNKCIJA..
127 T=E=SUM((j,l,k),Q(j)*Xjlk*(D(l,k)*Ch(j)+C1(l,j))+SUM((m,j),Q(j)*(C2(m,j)-C1(l,j))*GAMAjlkm));
**** $125
128
129 MODEL STORE/ALL/;
130 SOLVE STORE USING MIP MINIMIZING T;
**** $257
131
132
GAMS 24.1.3 r41464 Released Jul 26, 2013 WEX-WEI x86_64/MS Windows 02/15/16 21:43:43 Page 2
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
Error Messages


125 Set is under control already
257 Solve statement not checked because of previous errors

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

RE: Material hoisting code problem

Post by Archiver »


Hi Darko

Your second sum is within the first sum, so check your parentheses.
Cheers
Renger

____________________

Modelworks

Gewerbestrasse 15

3600 Thun – Switzerland

+41 79 818 53 73

Info@modelworks.ch

blog.modelworks.ch
From: gamsworld@googlegroups.com [gamsworld@googlegroups.com] on behalf of Darko Tešić [darkotesic89@gmail.com]
Sent: Monday, February 15, 2016 21:44
To: gamsworld
Subject: Material hoisting code problem

Hi, i have some problems with GAMS code:

1 *Optimization of material hoisting operations and storage locations in mul
ty-storey building construction
2 OPTIONS
3 MIP = CPLEX;
4
5 SETS
6 j material /1*10/
7 l deponijske etaže /1*8/
8 k celice /1*5/
9 m etaže /1*30/;
10
11 PARAMETERS
12 Q(j) potreba materiala j v prostoru m [kg]
13 Ch(j) strošek horizontalnega transporta materiala j [EUR-m-kg];
14
15 Q('1')=2000;
16 Q('2')=1500;
17 Q('3')=6000;
18 Q('4')=1500;
19 Q('5')=4000;
20 Q('6')=3000;
21 Q('7')=2500;
22 Q('8')=1000;
23 Q('9')=500;
24 Q('10')=700;
25
26 Ch('1')=20;
27 Ch('2')=22.5;
28 Ch('3')=15;
29 Ch('4')=23;
30 Ch('5')=10;
31 Ch('6')=10;
32 Ch('7')=23;
33 Ch('8')=14;
34 Ch('9')=15;
35 Ch('10')=16;
36
37 TABLE
38 D(l,k) razdalja od celice k do tovornega dvigala v etaži prostora l [m]
39 1 2 3 4 5
40 1 10 15 20 15 10
41 2 10 15 20 15 10
42 3 10 15 20 15 10
43 4 10 15 20 15 10
44 5 10 15 20 15 10
45 6 10 15 20 15 10
46 7 10 15 20 15 10
47 8 10 15 20 15 10;
48
49 TABLE
50 C1(l,j) strošek vertikalnega transporta materiala j do prostora l [EUR-kg]
51 1 2 3 4 5 6 7 8 9 10
52 1 15 20 13 20 7 7 26 11 12 13
53 2 16.2 21.2 14.2 21.2 8 8.2 27.2 12.2 13.2 14.2
54 3 17.4 22.4 15.4 22.4 9.4 9.4 28.4 13.4 14.4 15.4
55 4 18.6 23.6 16.6 23.6 10.6 10.6 29.6 14.6 15.6 16.6
56 5 19.8 24.8 17.8 24.8 11.8 11.8 30.8 15.8 16.8 17.8
57 6 21 26 19 26 13 13 32 17 18 19
58 7 22.2 27.2 20.2 27.2 14.2 14.2 33.2 18.2 19.2 20.2
59 8 23.4 28.4 21.4 28.4 15.4 15.4 34.4 19.4 20.4 21.4
;
60
61 TABLE
62 C2(m,j) strošek vertikalnega transporta materiala j do etaže m [EUR-kg]
63 1 2 3 4 5 6 7 8 9 10
64 1 15 20 13 20 7 7 26 11 12 13
65 2 16.2 21.2 14.2 21.2 8 8.2 27.2 12.2 13.2 14.2
66 3 17.4 22.4 15.4 22.4 9.4 9.4 28.4 13.4 14.4 15.4
67 4 18.6 23.6 16.6 23.6 10.6 10.6 29.6 14.6 15.6 16.6
68 5 19.8 24.8 17.8 24.8 11.8 11.8 30.8 15.8 16.8 17.8
69 6 21 26 19 26 13 13 32 17 18 19
70 7 22.2 27.2 20.2 27.2 14.2 14.2 33.2 18.2 19.2 20.2
71 8 23.4 28.4 21.4 28.4 15.4 15.4 34.4 19.4 20.4 21.4
72 9 24.6 29.6 22.6 29.6 16.6 16.6 35.6 20.6 21.6 22.6
73 10 25.8 30.8 23.8 30.8 17.8 17.8 36.8 21.8 22.8 23.8
74 11 27 32 25 32 19 19 38 23 24 25
75 12 28.2 33.2 26.2 33.2 20.2 20.2 39.2 24.2 25.2 26.2
76 13 29.4 34.4 27.4 34.4 21.4 21.4 40.4 25.4 26.4 27.4
77 14 30.6 35.6 38.6 35.6 22.6 22.6 41.6 26.6 27.6 28.6
78 15 31.8 36.8 29.8 36.8 23.8 23.8 42.8 27.8 28.8 29.8
79 16 33 38 31 38 25 25 44 29 30 31
80 17 34.2 39.2 32.2 39.2 26.2 26.2 45.2 30.2 31.2 32.2
81 18 35.4 40.4 33.4 40.4 27.4 27.4 46.4 31.4 32.4 33.4
82 19 36.6 41.6 34.6 41.6 28.6 28.6 47.6 32.6 33.6 34.6
83 20 37.8 42.8 35.8 42.8 29.8 29.8 48.8 33.8 34.8 35.8
84 21 39 44 37 44 31 31 50 35 36 37
85 22 40.2 45.2 38.2 45.2 32.2 32.2 51.2 36.2 37.2 38.2
86 23 41.4 46.4 39.4 46.4 33.4 33.4 52.4 37.4 38.4 39.4
87 24 42.6 47.6 40.6 47.6 34.6 34.6 53.6 38.6 39.6 40.6
88 25 43.8 48.8 41.8 48.8 35.8 35.8 54.8 39.8 40.8 41.8
89 26 45 50 43 50 37 37 56 41 42 43
90 27 46.2 51.2 44.2 51.2 38.2 38.2 57.2 42.2 43.2 44.2
91 28 47.4 52.4 45.4 52.4 39.4 39.4 58.4 43.4 44.4 45.4
92 29 48.6 53.6 46.6 53.6 40.6 40.6 59.6 44.6 45.6 46.6
93 30 49.8 54.8 47.8 54.8 41.8 41.8 60.8 45.8 46.8 47.8;
94
95 VARIABLE
96 T skupni transportni strošek;
97
98 BINARY VARIABLE
99 DELTAjm odločitvena spremenljivka 0 material j ni potreben v etaži m 1
material j potrebujejo v etaži m
100 Xjlk odločitvena spremenljivka 1 material j je deponiran v celici k v pros
toru m
101 GAMAjlkm odločitvena spremenljivka 1 pomeni da je bil material j iz celice
k (v prostoru l) dostavljen do etaže m ;
102
103 SCALAR
104 N veliko Å¡tevilo /999999999999999/;
105
106 EQUATIONS
107 ENACBA7
108 ENACBA8
109 ENACBA9
110 ENACBA10
111 NAMENSKAFUNKCIJA;
112
113 ENACBA7..
114 SUM(j,Xjlk)=E=1;
115
116 ENACBA8..
117 SUM((l,k),Xjlk)=L=1;
118
119 ENACBA9..
120 N*SUM(j,Q(j))=G=DELTAjm;
121
122 ENACBA10..
123 N*(2-Xjlk-DELTAjm)+GAMAjlkm=G=1;
124
125
126 NAMENSKAFUNKCIJA..
127 T=E=SUM((j,l,k),Q(j)*Xjlk*(D(l,k)*Ch(j)+C1(l,j))+SUM((m,j),Q(j)*(C2(m,j)-C1(l,j))*GAMAjlkm));
**** $125
128
129 MODEL STORE/ALL/;
130 SOLVE STORE USING MIP MINIMIZING T;
**** $257
131
132
GAMS 24.1.3 r41464 Released Jul 26, 2013 WEX-WEI x86_64/MS Windows 02/15/16 21:43:43 Page 2
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
Error Messages


125 Set is under control already
257 Solve statement not checked because of previous errors

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: Material hoisting code problem

Post by Archiver »



Can you help me to structure this equation with gams code posted earlier? Thanks

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Post Reply