目录

1 概述

2设备布局设计相关概念

3 运行结果

4 结论

5 Matlab代码及文章讲解 


1 概述

我国制造系统的设备布局设计过程中如何可以更加高效准确的计算得到设备布局设计结果是十分重要的,并且智能优化算法的因素是当前增加我国制造业在国际市场上的竞争力的主要因素。而智能优化算法可以帮助设备在不同生产条件、制作人员人数不同、制造产品标准等不同数值进行计算,得到更加合理的设备布局设计,在物流运输成本、产品生产效率和产品生产质量等得到提高"。

本文主要研究了在设备布局设计中应用智能优化算法所带来的优势。首先,本文介绍了相关智能优化算法,帮助对其来源及工作原理等进行深度理解。然后,本文通过设备布局设计的相关概念进行介绍,加深对所要解决的布局设计问题的理解。最后,本文通过粒子群优化算法算法在设备布局设计中的应用为例,表明智能优化算法在设备布局设计中解决问题的优势。

2设备布局设计相关概念

设备布局设计是指将生产设备和辅助设备根据场地、功能和协作配合等将相关设备管道等进行合理的安排放置,保障企业生产工作可以正确顺利的开展,并且资源相互传递过程中出现的物流成本和时效等都可以做到最小化的设计。而在此过程中最重要的两个因素是设备的位置和场地的面积。设备布局设计是空间组织问题,通过计算将设备进行搭配,完成生产链的循环,减少工业废物的出现,增加产品的利用率,提升生产效率,节约生产成本,使得制造企业的经济利益最大化。

3 运行结果

【设备布局】基于粒子群优化算法的设备布局设计研究(Matlab代码实现)_优化算法

【设备布局】基于粒子群优化算法的设备布局设计研究(Matlab代码实现)_matlab_02

部分代码:



clc;
clear;
close all;

%% Problem Definition

model=CreateModel(); % Create Model

CostFunction=@(sol1) MyCost(sol1,model); % Cost Function

Vars.xhat.Min=0;
Vars.xhat.Max=1;
Vars.xhat.Size=[1 model.n];
Vars.xhat.Count=prod(Vars.xhat.Size);
Vars.xhat.VelMax=0.1*(Vars.xhat.Max-Vars.xhat.Min);
Vars.xhat.VelMin=-Vars.xhat.VelMax;

Vars.yhat.Min=0;
Vars.yhat.Max=1;
Vars.yhat.Size=[1 model.n];
Vars.yhat.Count=prod(Vars.yhat.Size);
Vars.yhat.VelMax=0.1*(Vars.yhat.Max-Vars.yhat.Min);
Vars.yhat.VelMin=-Vars.yhat.VelMax;

Vars.rhat.Min=0;
Vars.rhat.Max=1;
Vars.rhat.Size=[1 model.n];
Vars.rhat.Count=prod(Vars.rhat.Size);
Vars.rhat.VelMax=0.1*(Vars.rhat.Max-Vars.rhat.Min);
Vars.rhat.VelMin=-Vars.rhat.VelMax;

%% PSO Parameters

MaxIt=500; % Maximum Number of Iterations

nPop=50; % Population Size (Swarm Size)

w=1.0; % Inertia Weight
wdamp=0.99; % Inertia Weight Damping Ratio
c1=0.7; % Personal Learning Coefficient
c2=1.5; % Global Learning Coefficient

% % Constriction Coefficients
% phi1=2.05;
% phi2=2.05;
% phi=phi1+phi2;
% chi=2/(phi-2+sqrt(phi^2-4*phi));
% w=chi; % Inertia Weight
% wdamp=1; % Inertia Weight Damping Ratio
% c1=chi*phi1; % Personal Learning Coefficient
% c2=chi*phi2; % Global Learning Coefficient


%% Initialization

empty_particle.Position=[];
empty_particle.Cost=[];
empty_particle.Sol=[];
empty_particle.Velocity=[];
empty_particle.Best.Position=[];
empty_particle.Best.Cost=[];
empty_particle.Best.Sol=[];

particle=repmat(empty_particle,nPop,1);

GlobalBest.Cost=inf;

for i=1:nPop

% Initialize Position
particle(i).Position=CreateRandomSolution(model);

% Initialize Velocity
particle(i).Velocity.xhat=zeros(Vars.xhat.Size);
particle(i).Velocity.yhat=zeros(Vars.yhat.Size);
particle(i).Velocity.rhat=zeros(Vars.rhat.Size);

% Evaluation
[particle(i).Cost, particle(i).Sol]=CostFunction(particle(i).Position);

% Update Personal Best
particle(i).Best.Position=particle(i).Position;
particle(i).Best.Cost=particle(i).Cost;
particle(i).Best.Sol=particle(i).Sol;

% Update Global Best
if particle(i).Best.Cost<GlobalBest.Cost
GlobalBest=particle(i).Best;
end
end

BestCost=zeros(MaxIt,1);


%% PSO Main Loop

for it=1:MaxIt

for i=1:nPop

% ---- Motion on xhat

% Update Velocity
particle(i).Velocity.xhat = w*particle(i).Velocity.xhat ...
+c1*rand(Vars.xhat.Size).*(particle(i).Best.Position.xhat-particle(i).Position.xhat) ...
+c2*rand(Vars.xhat.Size).*(GlobalBest.Position.xhat-particle(i).Position.xhat);

% Apply Velocity Limits
particle(i).Velocity.xhat = max(particle(i).Velocity.xhat,Vars.xhat.VelMin);
particle(i).Velocity.xhat = min(particle(i).Velocity.xhat,Vars.xhat.VelMax);

% Update Position
particle(i).Position.xhat = particle(i).Position.xhat + particle(i).Velocity.xhat;

% Velocity Mirror Effect
IsOutside=(particle(i).Position.xhat<Vars.xhat.Min | particle(i).Position.xhat>Vars.xhat.Max);
particle(i).Velocity.xhat(IsOutside)=-particle(i).Velocity.xhat(IsOutside);

% Apply Position Limits
particle(i).Position.xhat = max(particle(i).Position.xhat,Vars.xhat.Min);
particle(i).Position.xhat = min(particle(i).Position.xhat,Vars.xhat.Max);

% ---- Motion on yhat

% Update Velocity
particle(i).Velocity.yhat = w*particle(i).Velocity.yhat ...
+c1*rand(Vars.yhat.Size).*(particle(i).Best.Position.yhat-particle(i).Position.yhat) ...
+c2*rand(Vars.yhat.Size).*(GlobalBest.Position.yhat-particle(i).Position.yhat);

% Apply Velocity Limits
particle(i).Velocity.yhat = max(particle(i).Velocity.yhat,Vars.yhat.VelMin);
particle(i).Velocity.yhat = min(particle(i).Velocity.yhat,Vars.yhat.VelMax);

% Update Position
particle(i).Position.yhat = particle(i).Position.yhat + particle(i).Velocity.yhat;

% Velocity Mirror Effect
IsOutside=(particle(i).Position.yhat<Vars.yhat.Min | particle(i).Position.yhat>Vars.yhat.Max);
particle(i).Velocity.yhat(IsOutside)=-particle(i).Velocity.yhat(IsOutside);

% Apply Position Limits
particle(i).Position.yhat = max(particle(i).Position.yhat,Vars.yhat.Min);
particle(i).Position.yhat = min(particle(i).Position.yhat,Vars.yhat.Max);

% ---- Motion on rhat

% Update Velocity
particle(i).Velocity.rhat = w*particle(i).Velocity.rhat ...
+c1*rand(Vars.rhat.Size).*(particle(i).Best.Position.rhat-particle(i).Position.rhat) ...
+c2*rand(Vars.rhat.Size).*(GlobalBest.Position.rhat-particle(i).Position.rhat);

% Apply Velocity Limits
particle(i).Velocity.rhat = max(particle(i).Velocity.rhat,Vars.rhat.VelMin);
particle(i).Velocity.rhat = min(particle(i).Velocity.rhat,Vars.rhat.VelMax);

% Update Position
particle(i).Position.rhat = particle(i).Position.rhat + particle(i).Velocity.rhat;

% Velocity Mirror Effect
IsOutside=(particle(i).Position.rhat<Vars.rhat.Min | particle(i).Position.rhat>Vars.rhat.Max);
particle(i).Velocity.rhat(IsOutside)=-particle(i).Velocity.rhat(IsOutside);

% Apply Position Limits
particle(i).Position.rhat = max(particle(i).Position.rhat,Vars.rhat.Min);
particle(i).Position.rhat = min(particle(i).Position.rhat,Vars.rhat.Max);

% Evaluation
[particle(i).Cost, particle(i).Sol] = CostFunction(particle(i).Position);

% Apply Mutation
NewParticle=particle(i);
NewParticle.Position = Mutate(particle(i).Position, Vars);
[NewParticle.Cost, NewParticle.Sol]=CostFunction(NewParticle.Position);
if NewParticle.Cost<=particle(i).Cost || rand < 0.2
particle(i)=NewParticle;
end

% Update Personal Best
if particle(i).Cost<particle(i).Best.Cost

particle(i).Best.Position=particle(i).Position;
particle(i).Best.Cost=particle(i).Cost;
particle(i).Best.Sol=particle(i).Sol;

% Update Global Best
if particle(i).Best.Cost<GlobalBest.Cost
GlobalBest=particle(i).Best;
end
end

end

% Apply Local Search (Improvement) to Global Best
NewParticle=GlobalBest;
NewParticle.Position=ImproveSolution(GlobalBest.Position,model,Vars);
[NewParticle.Cost, NewParticle.Sol]=CostFunction(NewParticle.Position);
if NewParticle.Cost<=GlobalBest.Cost
GlobalBest=NewParticle;
end

BestCost(it)=GlobalBest.Cost;

if GlobalBest.Sol.IsFeasible
FLAG=' (Feasible)';
else
FLAG='';
end
disp(['Iteration ' num2str(it) ': Best Cost = ' num2str(BestCost(it)) FLAG]);

w=w*wdamp;

% Plot Solution
figure(1);
PlotSolution(GlobalBest.Sol,model);
pause(0.01);

end

BestSol = GlobalBest;

%% Results

figure;
plot(BestCost,'Color','r','LineWidth',2);
xlabel('迭代次数');
ylabel('最优解');
grid on;

部分理论引用网络文献,如有侵权请联系删除。 

4 结论

随着我国科技和制造工业的不断大跨步迈进,我国对制造系统所提的要求和施加的压力都比较之前更加严重,而在科技使得我国智能优化算法在此过程中可以帮助制造系统的设备布局计算过程可以更快更准确的得到结果。因此,本文详细的研究备布局设计中应用智能优化算法中的所能起到的作用及其优势。

5 Matlab代码及文章讲解