【优化布局】基于遗传算法求解作业车间布局最小成本设计优化问题附matlab代码

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法       神经网络预测       雷达通信       无线传感器        电力系统

信号处理              图像处理               路径规划       元胞自动机        无人机 

⛄ 内容介绍

车间设备布局问题,是一个NP难问题.许多学者利用启发式算法来 求解并取得了一定的成果,但在模型中存在距离定义不合理的情况,均采用绝对距离的方式,存在不符合实际和计算不准确的情况;本文对距离的定义进行了改进, 并利用遗传算法对改进后的模型进行求解,效果良好,达到了预期目标.

⛄ 部分代码

function [ globalMin, opt_layout] = mld_ga_basic(popSize, numIter, len, wid, loads  )

% FUNCTION: mld_ga_basic Calculates the min load distance cost for a layout

% using a tournament approach mutation type genetic algorithm.  The layout

% is based on length (len) x width (wid) of the area of the building to

% assign departments.

% GA steps:

%  Initialize:

%  (1) Calculate the number of departments given the layout dimensions

%      based on length * width = departments ( 2 * 3 = 6 departments)

%  (2) Load matrix indicates the number of loads per/week from dep matrix of 4 rows of best layout

                tmpPop(k,:) = bestOf4Layout;

                switch k

                       % flip segment between two of the departments

                    case 2 % Flip

                        tmpPop(k,I:J) = tmpPop(k,J:-1:I);

                    case 3 % Swap departments

                        tmpPop(k,[I J]) = tmpPop(k,[J I]);

                    case 4 % Slide departments down

                       tmpPop(k,I:J) = tmpPop(k,[I+1:J I]);

                    otherwise % Do Nothing

                end

            end

             % using the original population, create a new population

            newPop(p-3:p,:) = tmpPop;

        end

        pop = newPop;      

 end

     function call_plot( xy, ~)

      subplot(1,2,1)

      plot(xy(:,1), xy(:,2),'rs','MarkerSize',50,...

      'MarkerEdgeColor','red',...

      'MarkerFaceColor',[1 .6 .6]); 

      xlim([0 len+1]); ylim([0 wid+1]);

      hold off;

      title('布局规划');

      xlabel('建筑长度'); ylabel('建筑宽度');

      labels = cellstr( num2str(layout') );  

      text(xy(:,1), xy(:,2), labels, 'HorizontalAlignment','center')

      drawnow;

      if iter>0

      subplot(1,2,2)

      dH=costHistory(costHistory>0);

      dI=costIteration(costIteration>0);

      plot(dI, dH,'b-'); 

      title(sprintf('Min LxD Cost = %1.4f',minCost));

      xlabel('迭代次数'); ylabel('费用');

      end

    end

 opt_layout=optLayout;

end

⛄ 运行结果

⛄ 参考文献

[1] 廖源泉. 基于遗传算法的车间设施布局优化及仿真研究[D]. 南华大学.

[2] 魏军凯, 吴芳, 戚峰. 基于遗传算法求解车间设备布局优化问题[J]. 兰州交通大学学报, 2011, 30(3):5.

[3] 魏军凯. 基于遗传算法求解车间设备布局优化问题[J]. 兰州交通大学学报, 2011(003):030.

⛳️ 完整代码

❤️部分理论引用网络文献,若有侵权联系博主删除

❤️ 关注我领取海量matlab电子书和数学建模资料

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值