LINGO sets:product /1..7/:capcity,value;need /1..14/:demand;link(product,need):cost,number;endsetsmin=@sum(link:cost*number)+@sum(product(i):value(i)*@sum(need(j):number(i,j)));@for(link(i,j):@sum(link(i,j):number(i,j))=5171);@for(product(1):@sum(nee
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/06 08:33:59
LINGO sets:product /1..7/:capcity,value;need /1..14/:demand;link(product,need):cost,number;endsetsmin=@sum(link:cost*number)+@sum(product(i):value(i)*@sum(need(j):number(i,j)));@for(link(i,j):@sum(link(i,j):number(i,j))=5171);@for(product(1):@sum(nee
LINGO
sets:
product /1..7/:capcity,value;
need /1..14/:demand;
link(product,need):cost,number;
endsets
min=@sum(link:cost*number)+@sum(product(i):value(i)*@sum(need(j):number(i,j)));
@for(link(i,j):@sum(link(i,j):number(i,j))=5171);
@for(product(1):@sum(need(j):number(1,j))>=500);
省略了data;请问三点
(1):我想计算value(i)*数据(number)每行和,这个目标函数写的对吗?
(2):要求number中行和大于500小于800
(3):如何计算number中第三列至第七列的列总和
LINGO sets:product /1..7/:capcity,value;need /1..14/:demand;link(product,need):cost,number;endsetsmin=@sum(link:cost*number)+@sum(product(i):value(i)*@sum(need(j):number(i,j)));@for(link(i,j):@sum(link(i,j):number(i,j))=5171);@for(product(1):@sum(nee
对于问题一:min=@sum(link(i,j):cost(i,j)*number(i,j))+@sum(product(i):value(i)*@sum(need(j):number(i,j)));
对于问题二:@for(need(j):500@sum(product(i):number(j,i)));
对于问题三:@for(need(j)|j#gt#3#and#j#lt#7:a=@sum(product(i):number(j,i))); !a为3到7列的和
不敢保证一定就是正确的,你可以参考下
希望对你有帮助