lingo选址问题,请问哪里错了model:sets:cun/1..12/:a;!村子;zhen/1..4/:b;!镇子;Routes(cun,zhen):c,x;!分配量矩阵;endsetsdata:a=2.6,2.4,2,1.8,3.2,4.6,3.4,2.3,3.2,1.4,3.2,1.8;!计划粮食;c=13,7,9,15,8,12,9,10,3,15,8,5,16,7,3,13,8,7,11,2
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 04:19:26
lingo选址问题,请问哪里错了model:sets:cun/1..12/:a;!村子;zhen/1..4/:b;!镇子;Routes(cun,zhen):c,x;!分配量矩阵;endsetsdata:a=2.6,2.4,2,1.8,3.2,4.6,3.4,2.3,3.2,1.4,3.2,1.8;!计划粮食;c=13,7,9,15,8,12,9,10,3,15,8,5,16,7,3,13,8,7,11,2
lingo选址问题,请问哪里错了
model:
sets:
cun/1..12/:a;!村子;
zhen/1..4/:b;!镇子;
Routes(cun,zhen):c,x;!分配量矩阵;
endsets
data:
a=2.6,2.4,2,1.8,3.2,4.6,3.4,2.3,3.2,1.4,3.2,1.8;!计划粮食;
c=13,7,9,15,8,12,9,10,3,15,8,5,
16,7,3,13,8,7,11,20,20,3,18,19,
12,2,14,6,7,13,12,11,2,4,5,5,
1,15,11,8,2,8,2,3,2,11,9,20;!距离;
enddata
[obj]min=@sum(routes(i,j):c(i,j)*x(i,j)*b(j));!目标值;
@for(zhen(j):@bin(b(j)));
@sum(zhen(j):b(j))=2;!四个小镇选两个;
@for(cun(i):[sup]@sum(zhen(j):x(i,j))=a(i));!计划粮食限制条件;
@for(zhen(j)|j#ge#3:[dem]@sum(cun(i):x(i,j))
lingo选址问题,请问哪里错了model:sets:cun/1..12/:a;!村子;zhen/1..4/:b;!镇子;Routes(cun,zhen):c,x;!分配量矩阵;endsetsdata:a=2.6,2.4,2,1.8,3.2,4.6,3.4,2.3,3.2,1.4,3.2,1.8;!计划粮食;c=13,7,9,15,8,12,9,10,3,15,8,5,16,7,3,13,8,7,11,2
没有任何语法错误 你那里如果有问题 请说清楚提示的是什么