lingo错误,求解决
model:!定义原始级和派生数;sets:points/0,1,2,3,4,5,6,7,8/:f;point_aim/1,2,3,4,5,6,7,8/:timea,ti...
model:
!定义原始级和派生数;
sets:
points/0,1,2,3,4,5,6,7,8/:f;
point_aim/1,2,3,4,5,6,7,8/:timea,timeb,q,s;
roads(points,points):dist,x1,time_between;
cars/1..3/;
reach/1 2 3 4 5 6 7 8/:time_reach;
road_car(roads,cars):x;
task_car(points,cars):y;
task_aim(point_aim,cars):y1;
endsets
!数据输入;
data:
dist=! ( 数据省略);
m=3;
timea=1 4 1 4 3 2 5 1.5;
timeb=4 6 2 7 5.5 5 8 4 ;
s=1 2 1 3 2 2.5 3 0.8;
q= 2 1.5 4.5 3 1.5 4 2.5 3;
capacity=8;
time_between=!(数据省略);
enddata
!目标函数;
min=@sum(roads(i,j):
dist(i,j)*
@sum(cars(k):
x(i,j,k)));
!定义x为0,1变量;
@for(task_car:@bin(y));
@for(task_aim:@bin(y1));
!约束一;表示k承受的任务量之和不大于车的容量;
@sum(point_aim(i):
q(i)*@sum(cars(k)|k#eq#1:
y1(i,k)))<=capacity;
@sum(point_aim(i):
q(i)*@sum(cars(k)|k#eq#2:
y1(i,k)))<=capacity;
@sum(point_aim(i):
q(i)*@sum(cars(k)|k#eq#3:
y1(i,k)))<=capacity;
!约束二:表示任务i只能由一辆车完成;
@for(point_aim(i):
@sum(cars(k):
y1(i,k))=1);
!约束三:表示由中心仓库0出发m辆车;
@sum(task_car(i,k)|i#eq#1:y(i,k))=m;
!约束四:表示每个客户点只有一辆车访问;
@for(points(j)|j#ne#1:
@sum(points(i):
@sum(cars(k):x(i,j,k)))=1);
!约束五:保证进入和离开一客户点的车辆数相同;
@for(points(p):
@sum(points(i)|i#ne#p:
@sum(cars(k):
x(i,p,k)))=1;
@sum(points(j)|i#ne#p:
@sum(cars(k):
x(p,j,k)))=1;
);
!约束六:时间约束;
@for(reach(i):time_reach(i)>@sum(point_aim(i):timea(i)));
@for(reach(j):time_reach(j)<@sum(point_aim(j):timeb(j)));
end
提示ill defined ... 展开
!定义原始级和派生数;
sets:
points/0,1,2,3,4,5,6,7,8/:f;
point_aim/1,2,3,4,5,6,7,8/:timea,timeb,q,s;
roads(points,points):dist,x1,time_between;
cars/1..3/;
reach/1 2 3 4 5 6 7 8/:time_reach;
road_car(roads,cars):x;
task_car(points,cars):y;
task_aim(point_aim,cars):y1;
endsets
!数据输入;
data:
dist=! ( 数据省略);
m=3;
timea=1 4 1 4 3 2 5 1.5;
timeb=4 6 2 7 5.5 5 8 4 ;
s=1 2 1 3 2 2.5 3 0.8;
q= 2 1.5 4.5 3 1.5 4 2.5 3;
capacity=8;
time_between=!(数据省略);
enddata
!目标函数;
min=@sum(roads(i,j):
dist(i,j)*
@sum(cars(k):
x(i,j,k)));
!定义x为0,1变量;
@for(task_car:@bin(y));
@for(task_aim:@bin(y1));
!约束一;表示k承受的任务量之和不大于车的容量;
@sum(point_aim(i):
q(i)*@sum(cars(k)|k#eq#1:
y1(i,k)))<=capacity;
@sum(point_aim(i):
q(i)*@sum(cars(k)|k#eq#2:
y1(i,k)))<=capacity;
@sum(point_aim(i):
q(i)*@sum(cars(k)|k#eq#3:
y1(i,k)))<=capacity;
!约束二:表示任务i只能由一辆车完成;
@for(point_aim(i):
@sum(cars(k):
y1(i,k))=1);
!约束三:表示由中心仓库0出发m辆车;
@sum(task_car(i,k)|i#eq#1:y(i,k))=m;
!约束四:表示每个客户点只有一辆车访问;
@for(points(j)|j#ne#1:
@sum(points(i):
@sum(cars(k):x(i,j,k)))=1);
!约束五:保证进入和离开一客户点的车辆数相同;
@for(points(p):
@sum(points(i)|i#ne#p:
@sum(cars(k):
x(i,p,k)))=1;
@sum(points(j)|i#ne#p:
@sum(cars(k):
x(p,j,k)))=1;
);
!约束六:时间约束;
@for(reach(i):time_reach(i)>@sum(point_aim(i):timea(i)));
@for(reach(j):time_reach(j)<@sum(point_aim(j):timeb(j)));
end
提示ill defined ... 展开
2个回答
ZESTRON
2024-09-04 广告
2024-09-04 广告
在Dr. O.K. Wack Chemie GmbH,我们高度重视ZESTRON的表界面分析技术。该技术通过深入研究材料表面与界面的性质,为提升产品质量与可靠性提供了有力支持。ZESTRON的表界面分析不仅涵盖了相变化、化学反应、吸附与解吸...
点击进入详情页
本回答由ZESTRON提供
2013-07-25
展开全部
很久不碰这个东东了,还真看不出来…………
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询