lingo运行错误,错误1017
发布网友
发布时间:2023-12-23 13:15
我来回答
共1个回答
热心网友
时间:2023-12-28 21:32
model:
!实验中心机房值班问题;
!集部分;
sets:
workers/w1..w7/;
workers_money(workers):money;
!每位工作者每小时的工资;
daytime/d1..d5/;!工作者每天工作的时间;
workers_max_daytime(workers,daytime):maxtime;!每位工作者最多的工作时长;
workers_daytime(workers,daytime):worktime;!每位工作者每天工作的时间;
endsets
!目标函数;
min=@sum(spendmoney:worktime*money);
目标函数有问题
!需求约束 每天的工作时间之和为14小时;
@for(daytime(d1):@for(workers(I):@for(worktime(I,d1)<=maxtime(I,d1):@sum(worktime(I,d1)=14))));
@for(daytime(d2):@for(workers(I):@for(worktime(I,d2)<=maxtime(I,d2):@sum(worktime(I,d2)=14))));
@for(daytime(d3):@for(workers(I):@for(worktime(I,d3)<=maxtime(I,d3):@sum(worktime(I,d3)=14))));
@for(daytime(d4):@for(workers(I):@for(worktime(I,d4)<=maxtime(I,d4):@sum(worktime(I,d4)=14))));
@for(daytime(d5):@for(workers(I):@for(worktime(I,d5)<=maxtime(I,d5):@sum(worktime(I,d5)=14))));
!数据部分;
data:
money=10 10 12 12 15 16 50;
maxtime=6 0 4 5 3 0 24
0 6 8 5 0 6 24
6 0 3 6 4 0 24
0 6 0 0 8 6 24
7 0 5 4 0 3 24;
enddata
end