lingo 目标函数的代码编写目标函数为 程序为:MODEL:sets:Warehouse/1..4/:a;&

lingo 目标函数的代码编写
目标函数为

程序为:
MODEL:
sets:
Warehouse/1..4/:a;
Customer/1..8/:b;
prize/1..4/:p;
qu/1..8/:q;
Routes(Warehouse,Customer):c,x;

endsets
!here are the parameters;
data:
a=6,8,6,22;
b=6,5,8,5,6,5,4,6;
p=92,88,90,86;
q=105,110,108,105,110,112,126,132;
c=2,11,3,4,12,16,22,26,
10,3,5,9,15,18,24,35,
7,8,1,2,8,13,33,48,
12,9,16,7,16,21,42,56;
enddata
!The objective;
[OBJ]max=@sum(q*x)-@sum(p*x)-@sum(Routes:c*x); // 这边不知道该怎么写,x应该是矩阵
!The supply constraints;
@for(Warehouse(i):[SUP]
@sum(Customer(j):x(i,j))=a(i););
!The demand constraints;
@for(Customer(j):[DEM]
@sum(Warehouse(i):x(i,j))<=b(j););
end

betty_bao 1年前 已收到1个回答 举报

一些故事 春芽

共回答了25个问题采纳率:96% 举报

max=@sum(routes(i,j):q(j)*x(i,j)+p(i)*x(i,j)-c(i,j)*x(i,j));

1年前

2
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 0.020 s. - webmaster@yulucn.com