matlab中bestindex,Palmer调度算法及Matlab程序

本文介绍了Palmer调度算法,一种基于作业加工时间按斜度顺序指标排列的启发式算法。该算法通过计算斜度指标来确定作业的优先级,并给出了一组示例数据及其在Matlab中的实现程序。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Palmer调度算法及Matlab程序

--Palmer D.Sequencing jobs through a multi-stage process in the minimum total time-a quick method of obtaining a near optimum. Operations Research Quarterly,1965,16:101:107

n作业m机器排程的Palmer启发式算法

Palmer启发式算法是基于作业的加工时间按斜度顺序指标排列作业的启发式算法。按机器的顺序,加工时间趋于增加的作业被赋予较大的优先权数。

作业i的斜度指标si定义为:

s(i)=Sigma[j=1:m](2j-m-1)t(i,j) i=1,2,...,n

其中:m为机器数目,t(i,j)为第i个作业在第j台机器上的加工时间。

按s(i)非增的顺序排列作业,可以构造出作业的加工序列:

s(i(i))>=s(i(2))>=...>=s(i(n))

注:求解效果不是太好。

如果5项作业在8台机器上的加工时间如下:

13     13     25      2     14     10     14     18

4      7      3     17      7      9     25      3

6     15      2      1     21      2      6      9

2      1     11      4      2      9     18      3

4      9     12      2      6     22      6     26

Palmer求解结果:

Makespan =148

Schedule =5     2     4     1     3

CDS求解结果:

Makespan =132

Schedule =4     5     2     1     3

两者对比,CDS解比Palmer解的Makespan短近13%;

对应的Matlab计算程序为Palmer.m:

function [Makespan,Schedule]=Palmer(PT)

[n,m]=size(PT);

if n<=1

error('The job qty must large than 2')

end

for i=1:n

SlopeIndex(i)=0;

for j=1:m

SlopeIndex(i)=SlopeIndex(i)+(2*j-m-1)*PT(i,j);

end

end

[Best,BestIndex]=sort(SlopeIndex,'descend');

StartTime(1:m,1:n)=0;

StartTime(1,BestIndex(1))=0;

for j=2:n

StartTime(1,BestIndex(j))=StartTime(1,BestIndex(j-1))+PT(BestIndex(j-1),1);

end

for k=2:m

StartTime(k,BestIndex(1))=StartTime(k-1,BestIndex(1))+PT(BestIndex(1),k-1);

for j=2:n

StartTime(k,BestIndex(j))=max(StartTime(k,BestIndex(j-1))+PT(BestIndex(j-1),k),...

StartTime(k-1,BestIndex(j))+PT(BestIndex(j),k-1));

end

end

Makespan=StartTime(m,BestIndex(n))+PT(BestIndex(n),m);

Schedule=BestIndex;

生产管理 调度

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值