Reply-to: gamsworld@googlegroups.com
Hello every body
I would be grateful if some one tell me how can i correct the following model. it has got $171 error.
thanks alot.
5 sets
6 i row / 16/
7 j column /16/
8
9 ;
10
11 Table c(i,j) distance between reads
12 1 2 3 4 5 6
13 1 0 5 6 3 3 4
14 2 0 0 5 4 3 3
15 3 0 0 0 4 5 6
16 4 0 0 0 0 6 6
17 5 0 0 0 0 0 5
18 6 0 0 0 0 0 0
19 ;
20
21
22 Variables
23 w1(i,j)
24 w2(i,j)
25 y1(i)
26 y2(i)
27 z
28 ObjectiveFunction
29 ;
30
31 Binary Variables w1,w2,y1,y2;
32 Positive Variable z;
33
34 w1.lo(i,j)=0;
35 w2.lo(i,j)=0;
36 y1.lo(i)=0;
37 y2.lo(i)=0;
38
39
40
41 Equations
42 obj
43 c1_1(j)
44 c1_2(j)
45 c1_3(j)
46 c1_4(j)
47 c1_5(j)
48 c1_6(j)
49 c1_7(j)
50 c1_8(j)
51 c1_9(j)
52 c1_10(j)
53
54 c2_2(i)
55 c2_3(i)
56 c2_4(i)
57 c2_5(i)
58 c2_6(i)
59 c2_7(i)
60 c2_8(i)
61 c2_9(i)
62 c2_10(i)
63 c2_11(i)
64
65 c3_1(j)
66 c3_2(j)
67 c3_3(j)
68 c3_4(j)
69 c3_5(j)
70 c3_6(j)
71 c3_7(j)
72 c3_8(j)
73 c3_9(j)
74 c3_10(j)
75
76 c4_1
77 c4_2
78 c4_3
79 c4_4
80 c4_5
81 c4_6
82
83 c5
84 c6
85 ;
86
87 obj … ObjectiveFunction =e= sum((i,j)(ord(j) ge (ord(i)+1)),c(i,j)*(w1
(i,j)+w2(i,j)))-z ;
88
89 c1_1(j)(ord(j) gt 1)… (w1(‘1’,j)-y1(‘1’)) =l= 0 ;
90 c1_2(j)(ord(j) gt 2).. (w1('2',j)-y1('2')) =l= 0 ;
91 c1_3(j)(ord(j) gt 3)… (w1(‘3’,j)-y1(‘3’)) =l= 0 ;
92 c1_4(j)(ord(j) gt 4).. (w1('4',j)-y1('4')) =l= 0 ;
93 c1_5(j)(ord(j) gt 5)… (w1(‘5’,j)-y1(‘5’)) =l= 0 ;
94
95 c1_6(j)(ord(j) gt 1).. (w2('1',j)-y2('1')) =l= 0 ;
96 c1_7(j)(ord(j) gt 2)… (w2(‘2’,j)-y2(‘2’)) =l= 0 ;
97 c1_8(j)(ord(j) gt 3).. (w2('3',j)-y2('3')) =l= 0 ;
98 c1_9(j)(ord(j) gt 4)… (w2(‘4’,j)-y2(‘4’)) =l= 0 ;
99 c1_10(j)(ord(j) gt 5).. (w2('5',j)-y2('5')) =l= 0 ;
100
101
102
103 c2_2(i)(ord(i) lt 2)… (w1(i,‘2’)-y1(‘2’)) =l= 0 ;
104 c2_3(i)(ord(i) lt 3).. (w1(i,'3')-y1('3')) =l= 0 ;
105 c2_4(i)(ord(i) lt 4)… (w1(i,‘4’)-y1(‘4’)) =l= 0 ;
106 c2_5(i)(ord(i) lt 5).. (w1(i,'5')-y1('5')) =l= 0 ;
107 c2_6(i)(ord(i) lt 6)… (w1(i,‘6’)-y1(‘6’)) =l= 0 ;
108
109 c2_7(i)(ord(i) lt 2).. (w2(i,'2')-y2('2')) =l= 0 ;
110 c2_8(i)(ord(i) lt 3)… (w2(i,‘3’)-y2(‘3’)) =l= 0 ;
111 c2_9(i)(ord(i) lt 4).. (w2(i,'4')-y2('4')) =l= 0 ;
112 c2_10(i)(ord(i) lt 5)… (w2(i,‘5’)-y2(‘5’)) =l= 0 ;
113 c2_11(i)(ord(i) lt 6).. (w2(i,'6')-y2('6')) =l= 0 ;
114
115 c3_1(j)(ord(j) gt 1)… (-w1(‘1’,j)+y1(‘1’)+y1(j)) =l= 1 ;
**** 171
116 c3_2(j)(ord(j) gt 2)… (-w1(‘2’,j)+y1(‘2’)+y1(j)) =l= 1 ;
**** 171
117 c3_3(j)(ord(j) gt 3)… (-w1(‘3’,j)+y1(‘3’)+y1(j)) =l= 1 ;
**** 171
118 c3_4(j)(ord(j) gt 4)… (-w1(‘4’,j)+y1(‘4’)+y1(j)) =l= 1 ;
**** 171
119 c3_5(j)(ord(j) gt 5)… (-w1(‘5’,j)+y1(‘5’)+y1(j)) =l= 1 ;
**** 171
120
121 c3_6(j)(ord(j) gt 1)… (-w2(‘1’,j)+y2(‘1’)+y2(j)) =l= 1 ;
**** 171
122 c3_7(j)(ord(j) gt 2)… (-w2(‘2’,j)+y2(‘2’)+y2(j)) =l= 1 ;
**** 171
123 c3_8(j)(ord(j) gt 3)… (-w2(‘3’,j)+y2(‘3’)+y2(j)) =l= 1 ;
**** 171
124 c3_9(j)(ord(j) gt 4)… (-w2(‘4’,j)+y2(‘4’)+y2(j)) =l= 1 ;
**** 171
125 c3_10(j)(ord(j) gt 5)…(-w2(‘5’,j)+y2(‘5’)+y2(j)) =l= 1 ;
**** $171
126
127
128 c4_1… y1(‘1’)+y2(‘1’)=l= 1;
129 c4_2… y1(‘2’)+y2(‘2’)=l= 1;
130 c4_3… y1(‘3’)+y2(‘3’)=l= 1;
131 c4_4… y1(‘4’)+y2(‘4’)=l= 1;
132 c4_5… y1(‘5’)+y2(‘5’)=l= 1;
133 c4_6… y1(‘6’)+y2(‘6’)=l= 1;
134
135 c5… sum(j,y1(j))- sum(j,y2(j))-z =e= 0;
**** $171 $171
136 c6… sum(j,y1(j))- sum(j,y2(j))+z =e= 0;
**** $171 $171
137
138 Model cluster /all/;
139
140 Option MIP = Cplex;
141
142 Solve cluster using MIP maximizing ObjectiveFunction;
**** $257
143
144 Display w1.l,w2.l,y1.l,y2.l,z.l,ObjectiveFunction.l;
**** $141 $141
GAMS 24.4.6 r52609 Released Jun 26, 2015 WIN-VS8 x86 32bit/MS Windows 09/02/15 20:15:52 Page 2
Maryam Etemadi
Error Messages
141 Symbol declared but no values have been assigned. Check for missing
data definition, assignment, data loading or implicit assignment
via a solve statement.
A wild shot: You may have spurious commas in the explanatory
text of a declaration. Check symbol reference list.
171 Domain violation for set
257 Solve statement not checked because of previous errors
**** 17 ERROR(S) 0 WARNING(S)
GAMS 24.4.6 r52609 Released Jun 26, 2015 WIN-VS8 x86 32bit/MS Windows 09/02/15 20:15:52 Page 3
Maryam Etemadi
Symbol Listing
–
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 http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.