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/28 00:17:53
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
x_oPƿ 7-6+LδB!PLLE0f4[˲ ;ٗ9紻+xzZM2ٝ7۞yi"zg|!'zWVbiEž3%9ɲDV YQE{A.0B:We).&yܬ%׊,ɉ sF p& VW 2 _|duQ\c|`5f' \}R HucD, H&ȅԷauB\KbZ{Tr5 LNhSu1Z?.;&N,O?7.2>کk3jіErMd݋]`wLԯ }3p :` +ǣa "+aLHsstFǭkAsMpTm9La_Ӽ2f&UxJQ7%3*!vJ=ש(RN1y35#{0|KVߞB}pɵ*86hvX30>lYnwv'}k@ۄo%b^Rލ gW

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列的和



不敢保证一定就是正确的,你可以参考下
希望对你有帮助

lingo中sets是什么? lingo下标的问题比如:sets:product/0,1,2,3,4,5,6,7/:m;endsets那么我在调用 m(0)为什么说我下标越界? lingo程序:model:sets:product/1..3/:a,b; row/1..5/:c,d,y; num/1..9/:x; endsets其中的product和num该怎么用?还有平时不是用的col么而不是num区别在哪? 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 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运行时出现improper use of set name!MODEL:建立集合;SETS:Three products; PRODUCT/A,B,C/;Two distctrs; DISTCTR/DCl,DC2/;F;Five customers; CUSTOMER/C1,C2,C3,C4,C5/; D=Demand for a product by a customer.; DEMLINK(PRODUCT,CUSTOMER):D; Each lingo for函数出错 sets:SUPPLY/s1 s2/;FACTORY/F1 F2/;DISTRIBUTION/D1 D2/;CUSTOMER/C1 C2/;MATERIAL/M1 M2 M3/;PRODUCT/P1/;TIME/T1 T2 T3 T4 T5/;SM_LINK(TIME,SUPPLY,MATERIAL):SMC,SMQ;FP_LINK(TIME,FACTORY,PRODUCT):FPc,FPQ;SFM_T_LINK(TIME,SUPPLY,FACTORY lingo sets中可以由已知数 和 未知数组成吗?例如 sets zuobio/1..22/:x,y; endsets 前20个已知,怎么写 product product lingo 关于and的用法sets:jishu/1..n/:x,h,y;endsets当i>1且i lingo中sets;xs/1,2,3,4,5/:alpha,nu,beta,gamma,pi,sigma;代表什么意思 LINGO中的目标函数的表示若已知条件model:sets:a/1..5/:q;b/1..10/:y;c(a,b):x;endsets若要表示的目标函数为:该如何在lingo中表示出来? 关于LINGO程序lingo程序如下:sets:a/1..5/:x; endsets data:x=1,2,3,4,5;enddata 若知道a(i):x(i)=5,如何写出程序求出i的值 LINGO中的目标函数的表示方法若已知model:sets:a/1..5/:q;b/1..10/:y;c(a,b):x;endsets若要表示的目标函数为:该如何在lingo中表示出来? 求以下公式lingo代码: 定义集为:sets: demand/1..8/:O,D; supply/1..14/:Y; link(demand,supply):w,c,di,z;endsets lingo @for中大于用什么表示 @FOR(product(J)|W(J)>0:SUM(WORKER(I):X(I,J))=1); W(J)>0 要怎样表示 一个lingo lingo中约束条件之间是 ‘或’ 的关系,应该如何表示?Lingo中是否允许?代码如下,就是最后一个循环出错,去掉后可以执行,最后一句错在哪?P是火车票价格;model:sets:citys/1..10/:;city/1..11/:u,t