LINGO运行出现语法错误MODELsets:num_j/1..2/:x;num_k/1..3/:p,z,f;num_l/1..4/:d1,d2,g;link_lj(num_l,num_j):c;link_kl(num_k,num_l):w1,w2;endsetsdata:p=?;z=?0;!参数优先因子p和单目标问题的最优值z需在每一步求解输入实际数
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 05:12:09
LINGO运行出现语法错误MODELsets:num_j/1..2/:x;num_k/1..3/:p,z,f;num_l/1..4/:d1,d2,g;link_lj(num_l,num_j):c;link_kl(num_k,num_l):w1,w2;endsetsdata:p=?;z=?0;!参数优先因子p和单目标问题的最优值z需在每一步求解输入实际数
LINGO运行出现语法错误
MODEL
sets:
num_j/1..2/:x;
num_k/1..3/:p,z,f;
num_l/1..4/:d1,d2,g;
link_lj(num_l,num_j):c;
link_kl(num_k,num_l):w1,w2;
endsets
data:
p=?;
z=?0;!参数优先因子p和单目标问题的最优值z需在每一步求解输入实际数值;
c=1,1,15,21,2,1,2,3;
g=16000,275000,20000,36000;
w1=1,0,0,0,0,1,0,0,0,0,0,0;
w2=1,0,0,0,0,0,0,0,0,0,0.4,0.6;
enddata
[OBJ]min=@sum(num_k:p*f);
@for(num_k(k):f(k)=@sum(num_l(l):(w1(k,l)*d1(l)+w2(k,l)*d2(l))););
@for(num_l(l):@sum(num_j(j):c(l,j)*x(j))+d1(l)-d2(l)=g(l););
@for(num_l(k)|k#lt#@size(num_k):@bnd(0,f(k),z(k)););
@for(num_j(j):x(j)>=0;@gin(x(j)););
@for(num_l(l):d1(l)>=0;d2(l)>=0;);
END
但运行的时候
LINGO运行出现语法错误MODELsets:num_j/1..2/:x;num_k/1..3/:p,z,f;num_l/1..4/:d1,d2,g;link_lj(num_l,num_j):c;link_kl(num_k,num_l):w1,w2;endsetsdata:p=?;z=?0;!参数优先因子p和单目标问题的最优值z需在每一步求解输入实际数
model后面要有冒号