model:title Location problem; sets:demand/1..6/:a,b,d; supply/1,2/:x,y,e; link(demand,supply):c; e
照书上写的,还是出错了.大惑不解.
错误代码:50
for函数使用不当
所用版本为lingo11
model:
title Location problem;
sets:
demand/1..6/:a,b,d;
supply/1,2/:x,y,e;
link(demand,supply):c;
endsets
data:
a=1.25 8.75 0.5 5.75 3 7.25;
b=1.25 0.75 4.75 5 6.5 7.75;
enddata
init:
x,y=5,1,2,7;
endinit
[obj]min=@SUM( link(i,j):c(i,j)*((x(j)-a(i))^2+(y(j)-b(i)^2)^(1/2));
@for(demand(i):@sum(supply(j):c(i,j);)=d(i));
@for(supply(i):@sum(demand(j):c(j,i);)
人气:297 ℃ 时间:2020-05-03 05:19:49
解答
少右括号 model:
title Location problem;
sets:
demand/1..6/:a,b,d;
supply/1,2/:x,y,e;
link(demand,supply):c;
endsets
data:
a=1.25 8.75 0.5 5.75 3 7.25;
b=1.25 0.75 4.75 5 6.5 7.75;
enddata
init:
x,y=5,1,2,7;
endinit
[obj]min=@SUM( link(i,j): c(i,j)*((x(j)-a(i))^2+(y(j)-b(i)^2)^(1/2)));
@for(demand(i): @sum(supply(j):c(i,j);)=d(i));
@for(supply(i): @sum(demand(j):c(j,i);)@for(supply:@free(X);@free(Y););
end
推荐
- 求比较顺畅地翻译一下这一个题目“An Exact Method for the Capacitated Location-Routing Problem”
- 一个直角三角形的面积是16cm,一条直角边的长是4cm,另一条直角边的长是
- 归去来兮辞中主要表达什么含义的
- 名词所有格 ten times drives
- 有长,宽,高,分别为20cm,10cm,6cm的砖一块,
- A friend who betrays you in the end was never your friend to begin with.
- 若根号32x的平方减16x的平方y的立方在实数范围内有意义,求实数x,y满足关系式,并花见这个二次根式.
- Please tell the difference between this one and that one.
猜你喜欢