Lingo@for循环和@if的语句 Lingo新手,不知道该怎么写程序,MODEL:SETS:city/A1..A4/:U;;links(city,city):distance,;quan/1..4/:A;demond/1..4/:D;link(quan,demond):c;ENDSETSDATA:distance=0,34,84,8,34,0,63,7,84,63,0,5,8,7,5,0;d=12,18,23,16;ENDDATAmax=@sum(link:a(i)*d(i));@for(quan:a(i)=@if(distance(i,j)#gt#10,0.3,0.5));end

问题描述:

Lingo@for循环和@if的语句 Lingo新手,不知道该怎么写程序,
MODEL:
SETS:
city/A1..A4/:U;;
links(city,city):distance,;
quan/1..4/:A;
demond/1..4/:D;
link(quan,demond):c;
ENDSETS
DATA:
distance=0,34,84,8,
34,0,63,7,
84,63,0,5,
8,7,5,0;
d=12,18,23,16;
ENDDATA
max=@sum(link:a(i)*d(i));
@for(quan:a(i)=@if(distance(i,j)#gt#10,0.3,0.5));
end