lingo中的语法问题2
发布网友
发布时间:2023-10-16 08:37
我来回答
共2个回答
热心网友
时间:2024-11-24 15:23
sets:
r/1..2/:a;
e/1..4/:b;
link(r,e):c,x;
endsets
min=@sum(link(i,j):c(i,j)*x(i,j));
ST !这个是什么?lingo语法里没有这个;
@for(r(i):@sum(e(j):x(i,j))=a(i));
@for(e(j):@sum(r(i):x(i,j))=b(j));
end
热心网友
时间:2024-11-24 15:23
sets:
r/1..2/:a;
e/1..4/:b;
link(r,e):c,x;
endsets
min=@sum(link(i,j):c(i,j)*x(i,j));
@for(r(i): @sum(e(j):x(i,j))=a(i));
@for(e(j): @sum(r(i):x(i,j))=b(j));
end
!去掉ST就可以了ST是约束条件的意思,用 lindo的时候必须要加这行,但是在lingo语法编程时加上这行是错误的,只有你用lindo语法编程时才要加上这行;