求高手给我检查一下下面的lingo程序有什么错误,谢啦!!!急!!!!
怎么老是显示r那地方出错呢?model:sets:room:s1,s2;light:a,b;open(room,light):r;endsetsdata:a=40,40,...
怎么老是显示r那地方出错呢?
model:
sets:
room:s1,s2;
light:a,b;
open(room,light):r;
endsets
data:
a=40,40,50,48,45
45,48,45,40,45
40,45,48,50,40
40,50,48,45,45
48,45,40,45,40
45,48,50,48,50
40,45,40,45,48
50,48,48,50,48
50,48,48,50,48;
b=42,42,48,50,36
36,36,36,36,36
27,75,48,50,42
42,48,50,36,36
36,36,36,36,27
75,48,50,48,50
36,36,27,75,48
50,48,48,50,48
50,48,48,25,45;
s1=57,79,173,173,115
108,108,108,99,108
57,222,171,189,63
76,172,175,115,108
108,108,99,144,63
230,171,189,171,184
99,144,63,230,171
189,171,171,189,180
135,135,162,63,108;
s2=51,70,154,154,102
96,96,96,88,96
51,197,152,168,56
68,153,156,102,96
96,96,88,128,56
204,152,168,152,164
88,128,56,204,152
168,152,152,168,160
120,120,144,56,96;
enddata
min=@sum(r*a*b);
@bin(r(i,j));
@sum(room(i,j):r(i,j)*s1)>=5320;
@sum(room(i,j):r(i,j)*s1)<=5600;
@sum(room(i,j):r(i,j)*s2)>=5600;
end
给出能运行的程序最好啊,谢谢!!!! 展开
model:
sets:
room:s1,s2;
light:a,b;
open(room,light):r;
endsets
data:
a=40,40,50,48,45
45,48,45,40,45
40,45,48,50,40
40,50,48,45,45
48,45,40,45,40
45,48,50,48,50
40,45,40,45,48
50,48,48,50,48
50,48,48,50,48;
b=42,42,48,50,36
36,36,36,36,36
27,75,48,50,42
42,48,50,36,36
36,36,36,36,27
75,48,50,48,50
36,36,27,75,48
50,48,48,50,48
50,48,48,25,45;
s1=57,79,173,173,115
108,108,108,99,108
57,222,171,189,63
76,172,175,115,108
108,108,99,144,63
230,171,189,171,184
99,144,63,230,171
189,171,171,189,180
135,135,162,63,108;
s2=51,70,154,154,102
96,96,96,88,96
51,197,152,168,56
68,153,156,102,96
96,96,88,128,56
204,152,168,152,164
88,128,56,204,152
168,152,152,168,160
120,120,144,56,96;
enddata
min=@sum(r*a*b);
@bin(r(i,j));
@sum(room(i,j):r(i,j)*s1)>=5320;
@sum(room(i,j):r(i,j)*s1)<=5600;
@sum(room(i,j):r(i,j)*s2)>=5600;
end
给出能运行的程序最好啊,谢谢!!!! 展开
1个回答
展开全部
好吧 改成这样 对不对不保证
model:
sets:
room:s1,s2;
light:a,b;
open(room,light):r;
endsets
data:
a=40,40,50,48,45
45,48,45,40,45
40,45,48,50,40
40,50,48,45,45
48,45,40,45,40
45,48,50,48,50
40,45,40,45,48
50,48,48,50,48
50,48,48,50,48;
b=42,42,48,50,36
36,36,36,36,36
27,75,48,50,42
42,48,50,36,36
36,36,36,36,27
75,48,50,48,50
36,36,27,75,48
50,48,48,50,48
50,48,48,25,45;
s1=57,79,173,173,115
108,108,108,99,108
57,222,171,189,63
76,172,175,115,108
108,108,99,144,63
230,171,189,171,184
99,144,63,230,171
189,171,171,189,180
135,135,162,63,108;
s2=51,70,154,154,102
96,96,96,88,96
51,197,152,168,56
68,153,156,102,96
96,96,88,128,56
204,152,168,152,164
88,128,56,204,152
168,152,152,168,160
120,120,144,56,96;
enddata
min=@sum(open(i,j):r(i,j)*a(j)*b(j));
@for(open(i,j):@bin(r(i,j)));
@sum(open(i,j):r(i,j)*s1(i))>=5320;
@sum(open(i,j):r(i,j)*s1(i))<=5600;
@sum(open(i,j):r(i,j)*s2(i))>=5600;
end
model:
sets:
room:s1,s2;
light:a,b;
open(room,light):r;
endsets
data:
a=40,40,50,48,45
45,48,45,40,45
40,45,48,50,40
40,50,48,45,45
48,45,40,45,40
45,48,50,48,50
40,45,40,45,48
50,48,48,50,48
50,48,48,50,48;
b=42,42,48,50,36
36,36,36,36,36
27,75,48,50,42
42,48,50,36,36
36,36,36,36,27
75,48,50,48,50
36,36,27,75,48
50,48,48,50,48
50,48,48,25,45;
s1=57,79,173,173,115
108,108,108,99,108
57,222,171,189,63
76,172,175,115,108
108,108,99,144,63
230,171,189,171,184
99,144,63,230,171
189,171,171,189,180
135,135,162,63,108;
s2=51,70,154,154,102
96,96,96,88,96
51,197,152,168,56
68,153,156,102,96
96,96,88,128,56
204,152,168,152,164
88,128,56,204,152
168,152,152,168,160
120,120,144,56,96;
enddata
min=@sum(open(i,j):r(i,j)*a(j)*b(j));
@for(open(i,j):@bin(r(i,j)));
@sum(open(i,j):r(i,j)*s1(i))>=5320;
@sum(open(i,j):r(i,j)*s1(i))<=5600;
@sum(open(i,j):r(i,j)*s2(i))>=5600;
end
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询